/* ============================================================
   Rocket Customer Service Portal - Design System
   Based on Rocket WM Design System (Navy/Orange)
   ============================================================ */

/* ------------------------------------------------------------
   1. CSS Variables / Design Tokens
   ------------------------------------------------------------ */
:root {
    /* Brand Colors */
    --rp-navy: #0b1726;
    --rp-navy-light: #1a2c42;
    --rp-navy-dark: #050b13;
    --rp-orange: #ff7a00;
    --rp-orange-light: #ff9933;
    --rp-orange-dark: #cc6200;
    --rp-blue: #1e3a5f;

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

    /* Semantic Colors */
    --rp-success: #10b981;
    --rp-warning: #f59e0b;
    --rp-danger: #ef4444;
    --rp-info: #3b82f6;

    /* Shared Properties */
    --rp-radius: 8px;
    --rp-radius-sm: 4px;
    --rp-radius-lg: 12px;
    --rp-radius-xl: 16px;
    --rp-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.06);
    --rp-shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07), 0 2px 4px rgba(0, 0, 0, 0.06);
    --rp-shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.08), 0 4px 6px rgba(0, 0, 0, 0.05);
    --rp-shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.1), 0 8px 10px rgba(0, 0, 0, 0.06);

    /* Transitions - 3-speed system */
    --rp-transition-fast: all 0.15s ease;
    --rp-transition: all 0.2s ease;
    --rp-transition-slow: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);

    /* Focus ring - double-ring for a11y */
    --rp-focus-ring: 0 0 0 2px var(--rp-white), 0 0 0 4px var(--rp-orange);

    /* Density - default is standard */
    --rp-density-spacing: 24px;
    --rp-density-cell-v: 12px;
    --rp-density-cell-h: 16px;
    --rp-density-card-padding: 20px;
    --rp-density-gap: 20px;

    /* Sidebar */
    --rp-sidebar-width: 260px;

    /* Typography */
    --rp-font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
        "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji",
        "Segoe UI Emoji";
    --rp-font-mono: "SFMono-Regular", Menlo, Monaco, Consolas,
        "Liberation Mono", "Courier New", monospace;
}

/* ------------------------------------------------------------
   2. Reset & Base
   ------------------------------------------------------------ */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
}

body {
    font-family: var(--rp-font-family);
    font-size: 14px;
    line-height: 1.6;
    color: var(--rp-gray-800);
    background-color: var(--rp-gray-50);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

a {
    color: var(--rp-orange);
    text-decoration: none;
    transition: var(--rp-transition);
}

a:hover {
    color: var(--rp-orange-dark);
    text-decoration: underline;
}

img {
    max-width: 100%;
    height: auto;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.3;
    color: var(--rp-gray-900);
    margin-bottom: 0.5em;
    letter-spacing: -0.02em;
}

h1 { font-size: 1.875rem; letter-spacing: -0.025em; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.125rem; letter-spacing: -0.015em; }
h5 { font-size: 1rem; letter-spacing: -0.01em; }
h6 { font-size: 0.875rem; letter-spacing: 0; }

p {
    margin-bottom: 1em;
}

ul, ol {
    list-style: none;
}

/* ------------------------------------------------------------
   3. Layout
   ------------------------------------------------------------ */
.rp-layout {
    display: flex;
    min-height: 100vh;
}

.rp-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--rp-sidebar-width);
    background: var(--rp-navy);
    color: var(--rp-white);
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 1000;
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
}

.rp-sidebar::-webkit-scrollbar {
    width: 4px;
}

.rp-sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.rp-sidebar::-webkit-scrollbar-thumb {
    background: var(--rp-navy-light);
    border-radius: 2px;
}

.rp-main {
    flex-grow: 1;
    margin-left: var(--rp-sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: margin-left 0.3s ease;
}

.rp-topbar {
    position: sticky;
    top: 0;
    z-index: 900;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--rp-gray-200);
    box-shadow: var(--rp-shadow);
    padding: 0 24px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.rp-content {
    flex-grow: 1;
    padding: var(--rp-density-spacing);
    max-width: 1400px;
    width: 100%;
}

/* ------------------------------------------------------------
   4. Sidebar
   ------------------------------------------------------------ */
.rp-logo {
    padding: 20px 20px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.rp-logo img {
    height: 36px;
    width: auto;
}

.rp-logo-text {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--rp-white);
    white-space: nowrap;
}

.rp-logo-text span {
    color: var(--rp-orange);
}

.rp-nav {
    flex-grow: 1;
    padding: 12px 0;
}

.rp-nav-section {
    padding: 16px 20px 6px;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--rp-gray-500);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.rp-nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 20px;
    color: var(--rp-gray-300);
    font-size: 0.875rem;
    font-weight: 500;
    transition: var(--rp-transition);
    border-left: 3px solid transparent;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.rp-nav-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--rp-white);
    text-decoration: none;
}

.rp-nav-item.active {
    background: rgba(255, 122, 0, 0.1);
    color: var(--rp-orange);
    border-left-color: var(--rp-orange);
}

.rp-nav-item .nav-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    opacity: 0.7;
}

.rp-nav-item.active .nav-icon {
    opacity: 1;
}

.rp-nav-item .nav-badge {
    margin-left: auto;
    background: var(--rp-orange);
    color: var(--rp-white);
    font-size: 0.6875rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
    min-width: 20px;
    text-align: center;
}

.rp-sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    flex-shrink: 0;
}

/* ------------------------------------------------------------
   5. Topbar
   ------------------------------------------------------------ */
.rp-topbar-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--rp-gray-900);
    display: flex;
    align-items: center;
    gap: 12px;
}

.rp-topbar-title .breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.875rem;
    font-weight: 400;
    color: var(--rp-gray-500);
}

.rp-topbar-title .breadcrumb a {
    color: var(--rp-gray-500);
}

.rp-topbar-title .breadcrumb a:hover {
    color: var(--rp-orange);
    text-decoration: none;
}

.rp-topbar-title .breadcrumb .separator {
    color: var(--rp-gray-300);
}

.rp-topbar-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.rp-sidebar-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--rp-gray-600);
    cursor: pointer;
    padding: 8px;
    border-radius: var(--rp-radius-sm);
    transition: var(--rp-transition);
    font-size: 1.25rem;
    line-height: 1;
}

.rp-sidebar-toggle:hover {
    background: var(--rp-gray-100);
    color: var(--rp-gray-900);
}

/* Language Switcher */
.lang-switcher {
    display: flex;
    align-items: center;
    gap: 4px;
    background: var(--rp-gray-100);
    border-radius: 20px;
    padding: 2px;
}

.lang-btn {
    padding: 4px 12px;
    font-size: 0.75rem;
    font-weight: 600;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    transition: var(--rp-transition);
    background: transparent;
    color: var(--rp-gray-500);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.lang-btn:hover {
    color: var(--rp-gray-700);
}

.lang-btn.active {
    background: var(--rp-white);
    color: var(--rp-navy);
    box-shadow: var(--rp-shadow);
}

/* User Menu */
.user-menu {
    position: relative;
}

.btn-user {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 8px 4px 4px;
    background: none;
    border: 1px solid var(--rp-gray-200);
    border-radius: var(--rp-radius);
    cursor: pointer;
    transition: var(--rp-transition);
    font-family: inherit;
}

.btn-user:hover {
    background: var(--rp-gray-50);
    border-color: var(--rp-gray-300);
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--rp-orange);
    color: var(--rp-white);
    font-size: 0.8125rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    text-transform: uppercase;
}

.user-avatar.avatar-blue { background: var(--rp-info); }
.user-avatar.avatar-green { background: var(--rp-success); }
.user-avatar.avatar-purple { background: #8b5cf6; }
.user-avatar.avatar-pink { background: #ec4899; }

.user-name {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--rp-gray-700);
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    min-width: 200px;
    background: var(--rp-white);
    border: 1px solid var(--rp-gray-200);
    border-radius: var(--rp-radius);
    box-shadow: var(--rp-shadow-lg);
    z-index: 1100;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
    padding: 4px 0;
}

.user-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-header {
    padding: 10px 14px;
    border-bottom: 1px solid var(--rp-gray-100);
    margin-bottom: 4px;
}

.dropdown-header .dropdown-user-name {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--rp-gray-900);
}

.dropdown-header .dropdown-user-email {
    font-size: 0.75rem;
    color: var(--rp-gray-500);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    font-size: 0.8125rem;
    color: var(--rp-gray-700);
    transition: var(--rp-transition);
    cursor: pointer;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    font-family: inherit;
}

.dropdown-item:hover {
    background: var(--rp-gray-50);
    color: var(--rp-gray-900);
    text-decoration: none;
}

.dropdown-item.danger {
    color: var(--rp-danger);
}

.dropdown-item.danger:hover {
    background: #fef2f2;
}

.dropdown-divider {
    height: 1px;
    background: var(--rp-gray-100);
    margin: 4px 0;
}

/* ------------------------------------------------------------
   6. Cards
   ------------------------------------------------------------ */
.card {
    background: var(--rp-white);
    border-radius: var(--rp-radius);
    box-shadow: var(--rp-shadow);
    border: 1px solid var(--rp-gray-200);
    overflow: hidden;
}

.card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--rp-gray-100);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.card-header h2,
.card-header h3,
.card-header h4 {
    margin-bottom: 0;
    font-size: 1rem;
    font-weight: 600;
}

.card-body {
    padding: var(--rp-density-card-padding);
}

.card-footer {
    padding: 12px 20px;
    border-top: 1px solid var(--rp-gray-100);
    background: var(--rp-gray-50);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

/* Stat Cards */
.stat-card {
    background: var(--rp-white);
    border-radius: var(--rp-radius);
    box-shadow: var(--rp-shadow);
    border: 1px solid var(--rp-gray-200);
    padding: var(--rp-density-card-padding);
    display: flex;
    flex-direction: column;
    gap: 4px;
    transition: var(--rp-transition-slow);
}

.stat-card:hover {
    box-shadow: var(--rp-shadow-md);
    transform: translateY(-1px);
}

.stat-card .stat-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--rp-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    margin-bottom: 8px;
}

.stat-card .stat-icon.orange { background: #fff3e6; color: var(--rp-orange); }
.stat-card .stat-icon.blue { background: #e8f0fe; color: var(--rp-info); }
.stat-card .stat-icon.green { background: #e6f7f0; color: var(--rp-success); }
.stat-card .stat-icon.red { background: #fdecea; color: var(--rp-danger); }

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--rp-gray-900);
    line-height: 1.2;
}

.stat-label {
    font-size: 0.8125rem;
    color: var(--rp-gray-500);
    font-weight: 500;
}

.stat-change {
    font-size: 0.75rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 4px;
}

.stat-change.up { color: var(--rp-success); }
.stat-change.down { color: var(--rp-danger); }

/* ------------------------------------------------------------
   7. Buttons
   ------------------------------------------------------------ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 16px;
    font-size: 0.875rem;
    font-weight: 500;
    font-family: inherit;
    line-height: 1.5;
    border: 1px solid transparent;
    border-radius: var(--rp-radius);
    cursor: pointer;
    transition: var(--rp-transition);
    white-space: nowrap;
    text-decoration: none;
    user-select: none;
}

.btn:hover {
    text-decoration: none;
}

.btn:focus {
    outline: none;
}

.btn:focus-visible {
    outline: none;
    box-shadow: var(--rp-focus-ring);
}

.btn:active:not(:disabled) {
    transform: scale(0.97);
    transition: transform 0.1s ease;
}

.btn:disabled,
.btn.disabled {
    opacity: 0.55;
    cursor: not-allowed;
    pointer-events: none;
}

/* Primary - Orange */
.btn-primary {
    background: var(--rp-orange);
    color: var(--rp-white);
    border-color: var(--rp-orange);
}

.btn-primary:hover {
    background: var(--rp-orange-dark);
    border-color: var(--rp-orange-dark);
    color: var(--rp-white);
}

.btn-primary:focus-visible {
    outline-color: var(--rp-orange-dark);
}

/* Secondary - Gray */
.btn-secondary {
    background: var(--rp-gray-100);
    color: var(--rp-gray-700);
    border-color: var(--rp-gray-200);
}

.btn-secondary:hover {
    background: var(--rp-gray-200);
    color: var(--rp-gray-800);
}

/* Success */
.btn-success {
    background: var(--rp-success);
    color: var(--rp-white);
    border-color: var(--rp-success);
}

.btn-success:hover {
    background: #059669;
    border-color: #059669;
    color: var(--rp-white);
}

/* Danger */
.btn-danger {
    background: var(--rp-danger);
    color: var(--rp-white);
    border-color: var(--rp-danger);
}

.btn-danger:hover {
    background: #dc2626;
    border-color: #dc2626;
    color: var(--rp-white);
}

/* Warning */
.btn-warning {
    background: var(--rp-warning);
    color: var(--rp-white);
    border-color: var(--rp-warning);
}

.btn-warning:hover {
    background: #d97706;
    border-color: #d97706;
    color: var(--rp-white);
}

/* Info */
.btn-info {
    background: var(--rp-info);
    color: var(--rp-white);
    border-color: var(--rp-info);
}

.btn-info:hover {
    background: #2563eb;
    border-color: #2563eb;
    color: var(--rp-white);
}

/* Outline Variants */
.btn-outline-primary {
    background: transparent;
    color: var(--rp-orange);
    border-color: var(--rp-orange);
}

.btn-outline-primary:hover {
    background: var(--rp-orange);
    color: var(--rp-white);
}

.btn-outline-secondary {
    background: transparent;
    color: var(--rp-gray-600);
    border-color: var(--rp-gray-300);
}

.btn-outline-secondary:hover {
    background: var(--rp-gray-100);
    color: var(--rp-gray-800);
}

.btn-outline-danger {
    background: transparent;
    color: var(--rp-danger);
    border-color: var(--rp-danger);
}

.btn-outline-danger:hover {
    background: var(--rp-danger);
    color: var(--rp-white);
}

/* Ghost / Link */
.btn-ghost {
    background: transparent;
    color: var(--rp-gray-600);
    border-color: transparent;
}

.btn-ghost:hover {
    background: var(--rp-gray-100);
    color: var(--rp-gray-800);
}

/* Sizes */
.btn-sm {
    padding: 4px 10px;
    font-size: 0.75rem;
    border-radius: var(--rp-radius-sm);
}

.btn-lg {
    padding: 12px 24px;
    font-size: 1rem;
}

.btn-block {
    display: flex;
    width: 100%;
}

/* Icon Button */
.btn-icon {
    padding: 8px;
    width: 36px;
    height: 36px;
}

.btn-icon.btn-sm {
    width: 28px;
    height: 28px;
    padding: 4px;
}

.btn-icon.btn-lg {
    width: 44px;
    height: 44px;
    padding: 10px;
}

/* Button Group */
.btn-group {
    display: inline-flex;
    gap: 0;
}

.btn-group .btn {
    border-radius: 0;
}

.btn-group .btn:first-child {
    border-radius: var(--rp-radius) 0 0 var(--rp-radius);
}

.btn-group .btn:last-child {
    border-radius: 0 var(--rp-radius) var(--rp-radius) 0;
}

.btn-group .btn + .btn {
    margin-left: -1px;
}

.btn-group input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

/* ------------------------------------------------------------
   8. Forms
   ------------------------------------------------------------ */
.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--rp-gray-700);
    margin-bottom: 4px;
}

.form-label .required {
    color: var(--rp-danger);
    margin-left: 2px;
}

.form-label-sm {
    display: block;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--rp-gray-500);
    margin-bottom: 2px;
}

.form-control {
    display: block;
    width: 100%;
    padding: 8px 12px;
    font-size: 0.875rem;
    font-family: inherit;
    line-height: 1.5;
    color: var(--rp-gray-800);
    background: var(--rp-white);
    border: 1px solid var(--rp-gray-300);
    border-radius: var(--rp-radius);
    transition: var(--rp-transition);
    appearance: none;
    -webkit-appearance: none;
}

.form-control:focus {
    outline: none;
    border-color: var(--rp-orange);
    box-shadow: var(--rp-focus-ring);
}

.form-control::placeholder {
    color: var(--rp-gray-400);
}

.form-control:disabled,
.form-control[readonly] {
    background: var(--rp-gray-100);
    color: var(--rp-gray-500);
    cursor: not-allowed;
}

.form-control.is-error {
    border-color: var(--rp-danger);
}

.form-control.is-error:focus {
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
}

/* Select */
select.form-control {
    padding-right: 32px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M6 8.825L1.175 4l.85-.85L6 7.15l3.975-3.975.85.825L6 8.825z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 12px;
}

/* Textarea */
textarea.form-control {
    resize: vertical;
    min-height: 80px;
}

/* Form help & error text */
.form-help {
    font-size: 0.75rem;
    color: var(--rp-gray-500);
    margin-top: 4px;
}

.form-error {
    font-size: 0.75rem;
    color: var(--rp-danger);
    margin-top: 4px;
}

/* Form Row (flexbox grid) */
.form-row {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.form-row > .form-group {
    flex: 1;
    min-width: 200px;
}

.form-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    padding-top: 16px;
    border-top: 1px solid var(--rp-gray-200);
    margin-top: 8px;
}

/* Checkbox & Radio */
.form-check {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    cursor: pointer;
}

.form-check input[type="checkbox"],
.form-check input[type="radio"] {
    width: 16px;
    height: 16px;
    accent-color: var(--rp-orange);
    cursor: pointer;
}

.form-check-label {
    font-size: 0.875rem;
    color: var(--rp-gray-700);
    cursor: pointer;
}

/* File Input */
.form-file {
    position: relative;
}

.form-file-input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.form-file-label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border: 2px dashed var(--rp-gray-300);
    border-radius: var(--rp-radius);
    background: var(--rp-gray-50);
    font-size: 0.875rem;
    color: var(--rp-gray-500);
    transition: var(--rp-transition);
    cursor: pointer;
}

.form-file-label:hover {
    border-color: var(--rp-orange);
    background: #fff8f0;
}

/* Search Input */
.form-search {
    position: relative;
}

.form-search .form-control {
    padding-left: 36px;
}

.form-search .search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--rp-gray-400);
    pointer-events: none;
}

/* ------------------------------------------------------------
   9. Tables
   ------------------------------------------------------------ */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--rp-radius);
    border: 1px solid var(--rp-gray-200);
}

.rp-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.rp-table thead {
    background: var(--rp-navy);
    color: var(--rp-white);
}

.rp-table thead th {
    padding: var(--rp-density-cell-v) var(--rp-density-cell-h);
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    text-align: left;
    white-space: nowrap;
    border-bottom: 2px solid var(--rp-navy-dark);
}

.rp-table thead th a {
    color: var(--rp-white);
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.rp-table thead th a:hover {
    color: var(--rp-orange-light);
    text-decoration: none;
}

.rp-table tbody tr {
    border-bottom: 1px solid var(--rp-gray-100);
    transition: var(--rp-transition);
}

.rp-table tbody tr:nth-child(even) {
    background: var(--rp-gray-50);
}

.rp-table tbody tr:hover {
    background: #fff8f0;
}

.rp-table tbody td {
    padding: var(--rp-density-cell-v) var(--rp-density-cell-h);
    vertical-align: middle;
    color: var(--rp-gray-700);
}

.rp-table tbody td a {
    font-weight: 500;
}

.rp-table .td-actions {
    white-space: nowrap;
    text-align: right;
}

.rp-table .td-actions .btn {
    margin-left: 4px;
}

/* Compact Table Variant */
.rp-table.table-compact thead th,
.rp-table.table-compact tbody td {
    padding: 8px 12px;
}

/* ------------------------------------------------------------
   10. Badges
   ------------------------------------------------------------ */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    font-size: 0.6875rem;
    font-weight: 600;
    line-height: 1.4;
    border-radius: 20px;
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.badge-primary {
    background: #fff3e6;
    color: var(--rp-orange-dark);
}

.badge-success {
    background: #e6f7f0;
    color: #047857;
}

.badge-warning {
    background: #fef3c7;
    color: #92400e;
}

.badge-danger {
    background: #fdecea;
    color: #b91c1c;
}

.badge-info {
    background: #e8f0fe;
    color: #1d4ed8;
}

.badge-default {
    background: var(--rp-gray-100);
    color: var(--rp-gray-600);
}

.badge-secondary {
    background: var(--rp-gray-200);
    color: var(--rp-gray-700);
}

/* Critical - pulsing red */
.badge-critical {
    background: var(--rp-danger);
    color: var(--rp-white);
    animation: pulse-critical 2s infinite;
}

@keyframes pulse-critical {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* Ticket Priority Badges */
.badge-high {
    background: #fdecea;
    color: #b91c1c;
}

.badge-medium {
    background: #fff3e6;
    color: var(--rp-orange-dark);
}

.badge-low {
    background: #e8f0fe;
    color: #1d4ed8;
}

/* Badge dot */
.badge-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.badge-dot.dot-success { background: var(--rp-success); }
.badge-dot.dot-warning { background: var(--rp-warning); }
.badge-dot.dot-danger { background: var(--rp-danger); }
.badge-dot.dot-info { background: var(--rp-info); }

/* ------------------------------------------------------------
   11. Alerts
   ------------------------------------------------------------ */
.alert {
    padding: 12px 16px;
    border-radius: var(--rp-radius);
    font-size: 0.875rem;
    line-height: 1.5;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 16px;
    border: 1px solid transparent;
}

.alert .alert-icon {
    flex-shrink: 0;
    margin-top: 1px;
}

.alert .alert-content {
    flex-grow: 1;
}

.alert .alert-title {
    font-weight: 600;
    margin-bottom: 2px;
}

.alert .alert-close {
    flex-shrink: 0;
    background: none;
    border: none;
    cursor: pointer;
    padding: 2px;
    opacity: 0.6;
    transition: var(--rp-transition);
    font-size: 1.125rem;
    line-height: 1;
    color: inherit;
}

.alert .alert-close:hover {
    opacity: 1;
}

.alert-success {
    background: #ecfdf5;
    border-color: #a7f3d0;
    color: #065f46;
}

.alert-error {
    background: #fef2f2;
    border-color: #fecaca;
    color: #991b1b;
}

.alert-warning {
    background: #fffbeb;
    border-color: #fde68a;
    color: #92400e;
}

.alert-info {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: #1e40af;
}

/* ------------------------------------------------------------
   12. Flash Messages
   ------------------------------------------------------------ */
.flash-container {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: 420px;
    width: 100%;
    pointer-events: none;
}

.flash-message {
    padding: 14px 18px;
    border-radius: var(--rp-radius);
    font-size: 0.875rem;
    font-weight: 500;
    box-shadow: var(--rp-shadow-lg);
    display: flex;
    align-items: center;
    gap: 10px;
    pointer-events: auto;
    animation: flash-slide-in 0.3s ease;
    border: 1px solid transparent;
}

.flash-message.flash-success {
    background: #ecfdf5;
    border-color: #a7f3d0;
    color: #065f46;
}

.flash-message.flash-error {
    background: #fef2f2;
    border-color: #fecaca;
    color: #991b1b;
}

.flash-message.flash-warning {
    background: #fffbeb;
    border-color: #fde68a;
    color: #92400e;
}

.flash-message.flash-info {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: #1e40af;
}

.flash-message .flash-close {
    margin-left: auto;
    background: none;
    border: none;
    cursor: pointer;
    padding: 2px;
    opacity: 0.6;
    transition: var(--rp-transition);
    color: inherit;
    font-size: 1rem;
    line-height: 1;
}

.flash-message .flash-close:hover {
    opacity: 1;
}

.flash-message.flash-hide {
    animation: flash-slide-out 0.3s ease forwards;
}

@keyframes flash-slide-in {
    from {
        opacity: 0;
        transform: translateX(40px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes flash-slide-out {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(40px);
    }
}

/* ------------------------------------------------------------
   13. Modals
   ------------------------------------------------------------ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s;
    backdrop-filter: blur(2px);
}

.modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--rp-white);
    border-radius: var(--rp-radius-lg);
    box-shadow: var(--rp-shadow-xl);
    width: 100%;
    max-width: 520px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    transform: scale(0.95) translateY(10px);
    transition: transform 0.2s ease;
}

.modal-overlay.show .modal {
    transform: scale(1) translateY(0);
}

.modal-sm { max-width: 380px; }
.modal-lg { max-width: 720px; }
.modal-xl { max-width: 960px; }

.modal-header {
    padding: 18px 20px;
    border-bottom: 1px solid var(--rp-gray-100);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.modal-header h3,
.modal-header h4 {
    margin-bottom: 0;
    font-size: 1.0625rem;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.25rem;
    color: var(--rp-gray-400);
    cursor: pointer;
    padding: 4px;
    border-radius: var(--rp-radius-sm);
    transition: var(--rp-transition);
    line-height: 1;
}

.modal-close:hover {
    color: var(--rp-gray-700);
    background: var(--rp-gray-100);
}

.modal-body {
    padding: 20px;
    overflow-y: auto;
    flex-grow: 1;
}

.modal-footer {
    padding: 14px 20px;
    border-top: 1px solid var(--rp-gray-100);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-shrink: 0;
}

/* Confirm Dialog */
.modal-confirm .modal-body {
    text-align: center;
    padding: 30px 20px;
}

.modal-confirm .confirm-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin: 0 auto 16px;
}

.modal-confirm .confirm-icon.icon-danger {
    background: #fdecea;
    color: var(--rp-danger);
}

.modal-confirm .confirm-icon.icon-warning {
    background: #fef3c7;
    color: var(--rp-warning);
}

.modal-confirm .confirm-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.modal-confirm .confirm-text {
    color: var(--rp-gray-500);
    font-size: 0.875rem;
}

/* ------------------------------------------------------------
   14. Filter Bar
   ------------------------------------------------------------ */
.filter-bar {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    flex-wrap: wrap;
    padding: 16px 20px;
    background: var(--rp-white);
    border-radius: var(--rp-radius);
    box-shadow: var(--rp-shadow);
    border: 1px solid var(--rp-gray-200);
    margin-bottom: 20px;
}

.filter-bar .form-group {
    margin-bottom: 0;
    flex: 1;
    min-width: 160px;
}

.filter-bar .form-control {
    font-size: 0.8125rem;
    padding: 7px 10px;
}

.filter-bar .btn {
    flex-shrink: 0;
}

.filter-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 16px;
}

.filter-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    font-size: 0.75rem;
    background: var(--rp-gray-100);
    color: var(--rp-gray-700);
    border-radius: 20px;
    font-weight: 500;
}

.filter-tag .tag-remove {
    cursor: pointer;
    opacity: 0.6;
    transition: var(--rp-transition);
    font-size: 0.875rem;
    line-height: 1;
}

.filter-tag .tag-remove:hover {
    opacity: 1;
}

/* ------------------------------------------------------------
   15. Pagination
   ------------------------------------------------------------ */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 16px 0;
}

.page-item {
    display: inline-flex;
}

.page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 8px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--rp-gray-600);
    background: var(--rp-white);
    border: 1px solid var(--rp-gray-200);
    border-radius: var(--rp-radius);
    transition: var(--rp-transition);
    cursor: pointer;
    text-decoration: none;
}

.page-link:hover {
    background: var(--rp-gray-50);
    border-color: var(--rp-gray-300);
    color: var(--rp-gray-800);
    text-decoration: none;
}

.page-item.active .page-link {
    background: var(--rp-orange);
    color: var(--rp-white);
    border-color: var(--rp-orange);
}

.page-item.disabled .page-link {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.pagination-info {
    font-size: 0.8125rem;
    color: var(--rp-gray-500);
    text-align: center;
    margin-top: 8px;
}

/* ------------------------------------------------------------
   16. Tabs
   ------------------------------------------------------------ */
.tab-nav {
    display: flex;
    border-bottom: 2px solid var(--rp-gray-200);
    gap: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.tab-btn {
    padding: 10px 18px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--rp-gray-500);
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    cursor: pointer;
    transition: var(--rp-transition);
    white-space: nowrap;
    font-family: inherit;
}

.tab-btn:hover {
    color: var(--rp-gray-700);
}

.tab-btn.active {
    color: var(--rp-orange);
    border-bottom-color: var(--rp-orange);
    font-weight: 600;
}

.tab-content {
    padding-top: 20px;
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
    animation: tab-fade-in 0.2s ease;
}

@keyframes tab-fade-in {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Pill-style tabs */
.tab-nav.tab-pills {
    border-bottom: none;
    gap: 4px;
    background: var(--rp-gray-100);
    border-radius: var(--rp-radius);
    padding: 3px;
    display: inline-flex;
}

.tab-nav.tab-pills .tab-btn {
    border-bottom: none;
    margin-bottom: 0;
    border-radius: var(--rp-radius);
    padding: 6px 14px;
    font-size: 0.8125rem;
}

.tab-nav.tab-pills .tab-btn.active {
    background: var(--rp-white);
    box-shadow: var(--rp-shadow);
    color: var(--rp-gray-900);
}

/* ------------------------------------------------------------
   17. Timeline (Ticket Comments)
   ------------------------------------------------------------ */
.timeline {
    position: relative;
    padding-left: 32px;
}

.timeline::before {
    content: "";
    position: absolute;
    left: 11px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--rp-gray-200);
}

.timeline-item {
    position: relative;
    padding-bottom: 24px;
}

.timeline-item:last-child {
    padding-bottom: 0;
}

.timeline-dot {
    position: absolute;
    left: -32px;
    top: 4px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--rp-white);
    border: 2px solid var(--rp-gray-300);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.6875rem;
    z-index: 1;
}

.timeline-dot.dot-orange {
    border-color: var(--rp-orange);
    color: var(--rp-orange);
}

.timeline-dot.dot-blue {
    border-color: var(--rp-info);
    color: var(--rp-info);
}

.timeline-dot.dot-green {
    border-color: var(--rp-success);
    color: var(--rp-success);
}

.timeline-dot.dot-system {
    background: var(--rp-gray-200);
    border-color: var(--rp-gray-200);
    color: var(--rp-gray-500);
}

.timeline-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
    flex-wrap: wrap;
}

.timeline-author {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--rp-gray-900);
}

.timeline-role {
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    padding: 1px 6px;
    border-radius: 4px;
    background: var(--rp-navy);
    color: var(--rp-white);
}

.timeline-role.role-customer {
    background: var(--rp-info);
}

.timeline-date {
    font-size: 0.75rem;
    color: var(--rp-gray-400);
    margin-left: auto;
}

.timeline-body {
    background: var(--rp-gray-50);
    border: 1px solid var(--rp-gray-200);
    border-radius: var(--rp-radius);
    padding: 12px 16px;
    font-size: 0.875rem;
    line-height: 1.7;
    color: var(--rp-gray-700);
}

.timeline-body p {
    margin-bottom: 0.75em;
}

.timeline-body p:last-child {
    margin-bottom: 0;
}

.timeline-item.system-event .timeline-body {
    background: transparent;
    border: none;
    padding: 0;
    font-size: 0.8125rem;
    color: var(--rp-gray-500);
    font-style: italic;
}

.timeline-attachments {
    margin-top: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.timeline-attachment {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: var(--rp-white);
    border: 1px solid var(--rp-gray-200);
    border-radius: var(--rp-radius-sm);
    font-size: 0.75rem;
    color: var(--rp-gray-600);
    transition: var(--rp-transition);
}

.timeline-attachment:hover {
    border-color: var(--rp-orange);
    color: var(--rp-orange);
    text-decoration: none;
}

/* ------------------------------------------------------------
   18. Grid System
   ------------------------------------------------------------ */
.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--rp-density-gap);
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--rp-density-gap);
}

.grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--rp-density-gap);
}

/* Flex helpers */
.flex {
    display: flex;
}

.flex-wrap {
    flex-wrap: wrap;
}

.flex-col {
    flex-direction: column;
}

.flex-between {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

.flex-start {
    display: flex;
    align-items: flex-start;
}

.flex-end {
    display: flex;
    justify-content: flex-end;
}

.items-center {
    align-items: center;
}

.flex-grow {
    flex-grow: 1;
}

.flex-shrink-0 {
    flex-shrink: 0;
}

/* Gap utilities */
.gap-1 { gap: 4px; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 16px; }
.gap-4 { gap: 24px; }

/* ------------------------------------------------------------
   19. Utilities
   ------------------------------------------------------------ */

/* Text Alignment */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }

/* Text Color */
.text-muted { color: var(--rp-gray-500); }
.text-success { color: var(--rp-success); }
.text-danger { color: var(--rp-danger); }
.text-warning { color: var(--rp-warning); }
.text-info { color: var(--rp-info); }
.text-primary { color: var(--rp-orange); }
.text-white { color: var(--rp-white); }
.text-dark { color: var(--rp-gray-900); }

/* Font Weight */
.font-normal { font-weight: 400; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }

/* Font Size */
.text-xs { font-size: 0.75rem; }
.text-sm { font-size: 0.8125rem; }
.text-base { font-size: 0.875rem; }
.text-lg { font-size: 1rem; }
.text-xl { font-size: 1.25rem; }

/* Margin Top */
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 16px; }
.mt-4 { margin-top: 24px; }
.mt-5 { margin-top: 32px; }

/* Margin Bottom */
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 4px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 16px; }
.mb-4 { margin-bottom: 24px; }
.mb-5 { margin-bottom: 32px; }

/* Margin Right */
.mr-1 { margin-right: 4px; }
.mr-2 { margin-right: 8px; }
.mr-3 { margin-right: 16px; }

/* Margin Left */
.ml-1 { margin-left: 4px; }
.ml-2 { margin-left: 8px; }
.ml-3 { margin-left: 16px; }
.ml-auto { margin-left: auto; }

/* Padding */
.p-0 { padding: 0; }
.p-1 { padding: 4px; }
.p-2 { padding: 8px; }
.p-3 { padding: 16px; }
.p-4 { padding: 24px; }
.p-5 { padding: 32px; }

.px-1 { padding-left: 4px; padding-right: 4px; }
.px-2 { padding-left: 8px; padding-right: 8px; }
.px-3 { padding-left: 16px; padding-right: 16px; }
.px-4 { padding-left: 24px; padding-right: 24px; }

.py-1 { padding-top: 4px; padding-bottom: 4px; }
.py-2 { padding-top: 8px; padding-bottom: 8px; }
.py-3 { padding-top: 16px; padding-bottom: 16px; }
.py-4 { padding-top: 24px; padding-bottom: 24px; }

/* Display */
.hidden { display: none !important; }
.block { display: block; }
.inline-block { display: inline-block; }
.inline-flex { display: inline-flex; }

/* Overflow */
.truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.overflow-hidden { overflow: hidden; }
.overflow-auto { overflow: auto; }

/* Width */
.w-full { width: 100%; }
.w-auto { width: auto; }

/* Border */
.border { border: 1px solid var(--rp-gray-200); }
.border-top { border-top: 1px solid var(--rp-gray-200); }
.border-bottom { border-bottom: 1px solid var(--rp-gray-200); }
.rounded { border-radius: var(--rp-radius); }
.rounded-lg { border-radius: var(--rp-radius-lg); }

/* Background */
.bg-white { background-color: var(--rp-white); }
.bg-gray-50 { background-color: var(--rp-gray-50); }
.bg-gray-100 { background-color: var(--rp-gray-100); }

/* Shadow */
.shadow { box-shadow: var(--rp-shadow); }
.shadow-md { box-shadow: var(--rp-shadow-md); }
.shadow-none { box-shadow: none; }

/* Cursor */
.cursor-pointer { cursor: pointer; }

/* Divider */
.divider {
    border: none;
    height: 1px;
    background: var(--rp-gray-200);
    margin: 16px 0;
}

/* ------------------------------------------------------------
   20. SLA Indicators
   ------------------------------------------------------------ */
.sla-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 20px;
    white-space: nowrap;
}

.sla-badge .sla-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}

.sla-ok {
    background: #e6f7f0;
    color: #047857;
}

.sla-ok .sla-dot {
    background: var(--rp-success);
}

.sla-warning {
    background: #fef3c7;
    color: #92400e;
}

.sla-warning .sla-dot {
    background: var(--rp-warning);
    animation: sla-blink 1.5s ease-in-out infinite;
}

.sla-breached {
    background: #fdecea;
    color: #b91c1c;
    animation: sla-shake 0.5s ease-in-out;
}

.sla-breached .sla-dot {
    background: var(--rp-danger);
    animation: sla-blink 0.8s ease-in-out infinite;
}

@keyframes sla-blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

@keyframes sla-shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-2px); }
    75% { transform: translateX(2px); }
}

/* SLA Timer */
.sla-timer {
    font-size: 0.8125rem;
    font-weight: 600;
    font-family: var(--rp-font-mono);
}

.sla-timer.overdue {
    color: var(--rp-danger);
}

/* ------------------------------------------------------------
   21. Knowledge Base
   ------------------------------------------------------------ */

/* KB Article Card */
.kb-card {
    background: var(--rp-white);
    border: 1px solid var(--rp-gray-200);
    border-radius: var(--rp-radius);
    padding: 20px;
    transition: var(--rp-transition);
    display: flex;
    flex-direction: column;
    gap: 8px;
    cursor: pointer;
}

.kb-card:hover {
    box-shadow: var(--rp-shadow-md);
    border-color: var(--rp-orange-light);
    transform: translateY(-2px);
    text-decoration: none;
}

.kb-card .kb-card-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--rp-gray-900);
    margin-bottom: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.kb-card .kb-card-excerpt {
    font-size: 0.8125rem;
    color: var(--rp-gray-500);
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 0;
}

.kb-card .kb-card-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.75rem;
    color: var(--rp-gray-400);
    margin-top: auto;
    padding-top: 8px;
    border-top: 1px solid var(--rp-gray-100);
}

/* KB Category Card */
.kb-category-card {
    background: var(--rp-white);
    border: 1px solid var(--rp-gray-200);
    border-radius: var(--rp-radius);
    padding: 24px;
    text-align: center;
    transition: var(--rp-transition);
    cursor: pointer;
}

.kb-category-card:hover {
    box-shadow: var(--rp-shadow-md);
    transform: translateY(-2px);
    text-decoration: none;
}

.kb-category-card .kb-category-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--rp-radius-lg);
    background: #fff3e6;
    color: var(--rp-orange);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    margin: 0 auto 12px;
}

.kb-category-card .kb-category-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--rp-gray-900);
    margin-bottom: 4px;
}

.kb-category-card .kb-category-count {
    font-size: 0.8125rem;
    color: var(--rp-gray-400);
}

/* FAQ Item (Accordion) */
.faq-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.faq-item {
    background: var(--rp-white);
    border: 1px solid var(--rp-gray-200);
    border-radius: var(--rp-radius);
    overflow: hidden;
    transition: var(--rp-transition);
}

.faq-item.open {
    border-color: var(--rp-orange-light);
    box-shadow: 0 0 0 1px rgba(255, 122, 0, 0.1);
}

.faq-question {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 18px;
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--rp-gray-800);
    cursor: pointer;
    transition: var(--rp-transition);
    background: none;
    border: none;
    width: 100%;
    text-align: left;
    font-family: inherit;
}

.faq-question:hover {
    color: var(--rp-orange);
}

.faq-question .faq-toggle {
    flex-shrink: 0;
    transition: transform 0.2s ease;
    color: var(--rp-gray-400);
}

.faq-item.open .faq-question .faq-toggle {
    transform: rotate(180deg);
    color: var(--rp-orange);
}

.faq-answer {
    padding: 0 18px 16px;
    font-size: 0.875rem;
    line-height: 1.7;
    color: var(--rp-gray-600);
    display: none;
}

.faq-item.open .faq-answer {
    display: block;
    animation: faq-expand 0.2s ease;
}

@keyframes faq-expand {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Article Content Typography */
.article-content {
    font-size: 0.9375rem;
    line-height: 1.8;
    color: var(--rp-gray-700);
}

.article-content h1,
.article-content h2,
.article-content h3,
.article-content h4 {
    margin-top: 1.5em;
    margin-bottom: 0.5em;
}

.article-content h1 { font-size: 1.75rem; }
.article-content h2 { font-size: 1.375rem; }
.article-content h3 { font-size: 1.125rem; }

.article-content p {
    margin-bottom: 1em;
}

.article-content ul,
.article-content ol {
    margin-bottom: 1em;
    padding-left: 1.5em;
}

.article-content ul { list-style: disc; }
.article-content ol { list-style: decimal; }

.article-content li {
    margin-bottom: 0.25em;
}

.article-content a {
    color: var(--rp-orange);
    text-decoration: underline;
}

.article-content a:hover {
    color: var(--rp-orange-dark);
}

.article-content blockquote {
    border-left: 3px solid var(--rp-orange);
    padding: 12px 16px;
    margin: 16px 0;
    background: var(--rp-gray-50);
    border-radius: 0 var(--rp-radius) var(--rp-radius) 0;
    color: var(--rp-gray-600);
    font-style: italic;
}

.article-content code {
    background: var(--rp-gray-100);
    padding: 2px 6px;
    border-radius: var(--rp-radius-sm);
    font-size: 0.85em;
    font-family: var(--rp-font-mono);
    color: var(--rp-gray-800);
}

.article-content pre {
    background: var(--rp-gray-900);
    color: var(--rp-gray-100);
    padding: 16px;
    border-radius: var(--rp-radius);
    overflow-x: auto;
    margin: 16px 0;
    font-size: 0.85rem;
    line-height: 1.6;
}

.article-content pre code {
    background: none;
    padding: 0;
    color: inherit;
    font-size: inherit;
}

.article-content img {
    border-radius: var(--rp-radius);
    margin: 16px 0;
}

.article-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0;
}

.article-content table th,
.article-content table td {
    padding: 8px 12px;
    border: 1px solid var(--rp-gray-200);
    text-align: left;
}

.article-content table th {
    background: var(--rp-gray-50);
    font-weight: 600;
}

/* KB Search */
.kb-search {
    max-width: 560px;
    margin: 0 auto 32px;
}

.kb-search .form-control {
    padding: 14px 20px 14px 44px;
    font-size: 1rem;
    border-radius: var(--rp-radius-xl);
    box-shadow: var(--rp-shadow-md);
    border-color: var(--rp-gray-200);
}

.kb-search .form-control:focus {
    box-shadow: var(--rp-shadow-md), 0 0 0 3px rgba(255, 122, 0, 0.15);
}

/* ------------------------------------------------------------
   22. Login Page
   ------------------------------------------------------------ */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--rp-navy);
    padding: 24px;
    position: relative;
    overflow: hidden;
}

.login-page::before {
    content: "";
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(
        circle at 30% 40%,
        rgba(255, 122, 0, 0.08) 0%,
        transparent 50%
    ),
    radial-gradient(
        circle at 70% 60%,
        rgba(30, 58, 95, 0.3) 0%,
        transparent 50%
    );
    pointer-events: none;
}

.login-card {
    background: var(--rp-white);
    border-radius: var(--rp-radius-xl);
    box-shadow: var(--rp-shadow-xl);
    width: 100%;
    max-width: 420px;
    padding: 40px;
    position: relative;
    z-index: 1;
}

.login-logo {
    text-align: center;
    margin-bottom: 32px;
}

.login-logo img {
    height: 44px;
    width: auto;
}

.login-logo h1 {
    font-size: 1.375rem;
    font-weight: 700;
    color: var(--rp-gray-900);
    margin-top: 12px;
    margin-bottom: 4px;
}

.login-logo p {
    font-size: 0.875rem;
    color: var(--rp-gray-500);
    margin-bottom: 0;
}

.login-card .form-group {
    margin-bottom: 18px;
}

.login-card .form-control {
    padding: 10px 14px;
}

.login-card .btn-primary {
    padding: 10px 16px;
    font-size: 0.9375rem;
    font-weight: 600;
    width: 100%;
}

.login-footer {
    text-align: center;
    margin-top: 20px;
    font-size: 0.8125rem;
    color: var(--rp-gray-500);
}

.login-footer a {
    color: var(--rp-orange);
    font-weight: 500;
}

.login-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 20px 0;
    font-size: 0.75rem;
    color: var(--rp-gray-400);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.login-divider::before,
.login-divider::after {
    content: "";
    flex-grow: 1;
    height: 1px;
    background: var(--rp-gray-200);
}

/* Language selector on login */
.login-lang {
    display: flex;
    justify-content: center;
    margin-top: 16px;
}

/* Remember me / Forgot password row */
.login-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
    font-size: 0.8125rem;
}

.login-options a {
    color: var(--rp-orange);
}

/* Error display on login */
.login-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
    padding: 10px 14px;
    border-radius: var(--rp-radius);
    font-size: 0.8125rem;
    margin-bottom: 18px;
    text-align: center;
}

/* ------------------------------------------------------------
   23. Empty State
   ------------------------------------------------------------ */
.empty-state {
    text-align: center;
    padding: 48px 24px;
    max-width: 400px;
    margin: 0 auto;
}

.empty-state .empty-icon {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: var(--rp-gray-100);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 1.75rem;
    color: var(--rp-gray-400);
}

.empty-state .empty-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--rp-gray-800);
    margin-bottom: 8px;
}

.empty-state .empty-text {
    font-size: 0.875rem;
    color: var(--rp-gray-500);
    margin-bottom: 20px;
    line-height: 1.6;
}

.empty-state .btn {
    margin-top: 4px;
}

/* ------------------------------------------------------------
   24. Subscription Cards
   ------------------------------------------------------------ */
.subscription-card {
    background: var(--rp-white);
    border-radius: var(--rp-radius);
    box-shadow: var(--rp-shadow);
    border: 1px solid var(--rp-gray-200);
    overflow: hidden;
    transition: var(--rp-transition);
    position: relative;
}

.subscription-card:hover {
    box-shadow: var(--rp-shadow-md);
}

.subscription-card .subscription-accent {
    height: 4px;
    background: var(--rp-orange);
    width: 100%;
}

.subscription-card .subscription-accent.accent-blue {
    background: var(--rp-info);
}

.subscription-card .subscription-accent.accent-green {
    background: var(--rp-success);
}

.subscription-card .subscription-accent.accent-purple {
    background: #8b5cf6;
}

.subscription-card .subscription-header {
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--rp-gray-100);
}

.subscription-card .subscription-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--rp-gray-900);
    margin-bottom: 0;
}

.subscription-card .subscription-body {
    padding: 16px 20px;
}

.subscription-card .subscription-detail {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    font-size: 0.8125rem;
    border-bottom: 1px solid var(--rp-gray-50);
}

.subscription-card .subscription-detail:last-child {
    border-bottom: none;
}

.subscription-card .subscription-detail .detail-label {
    color: var(--rp-gray-500);
}

.subscription-card .subscription-detail .detail-value {
    font-weight: 600;
    color: var(--rp-gray-800);
}

.subscription-card .subscription-footer {
    padding: 12px 20px;
    border-top: 1px solid var(--rp-gray-100);
    background: var(--rp-gray-50);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

/* Subscription price highlight */
.subscription-price {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--rp-gray-900);
}

.subscription-price .price-period {
    font-size: 0.8125rem;
    font-weight: 400;
    color: var(--rp-gray-500);
}

/* Product Color Variants */
.subscription-card[data-product-color="blue"] .subscription-accent { background: var(--rp-info); }
.subscription-card[data-product-color="green"] .subscription-accent { background: var(--rp-success); }
.subscription-card[data-product-color="orange"] .subscription-accent { background: var(--rp-orange); }
.subscription-card[data-product-color="purple"] .subscription-accent { background: #8b5cf6; }
.subscription-card[data-product-color="red"] .subscription-accent { background: var(--rp-danger); }

/* ------------------------------------------------------------
   25. Page Header
   ------------------------------------------------------------ */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.page-header h1,
.page-header h2 {
    margin-bottom: 0;
}

.page-header .page-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* Page Description */
.page-description {
    font-size: 0.875rem;
    color: var(--rp-gray-500);
    margin-top: -16px;
    margin-bottom: 24px;
}

/* ------------------------------------------------------------
   26. Loading Spinner
   ------------------------------------------------------------ */
.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid var(--rp-gray-200);
    border-top-color: var(--rp-orange);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    display: inline-block;
}

.spinner-sm {
    width: 14px;
    height: 14px;
    border-width: 1.5px;
}

.spinner-lg {
    width: 32px;
    height: 32px;
    border-width: 3px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Loading Overlay */
.loading-overlay {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    border-radius: inherit;
}

/* Skeleton loading */
.skeleton {
    background: linear-gradient(90deg, var(--rp-gray-100) 25%, var(--rp-gray-200) 50%, var(--rp-gray-100) 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s infinite;
    border-radius: var(--rp-radius-sm);
}

.skeleton-text {
    height: 14px;
    margin-bottom: 8px;
    width: 100%;
}

.skeleton-text:last-child {
    width: 60%;
}

.skeleton-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

@keyframes skeleton-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ------------------------------------------------------------
   27. Tooltip
   ------------------------------------------------------------ */
[data-tooltip] {
    position: relative;
}

[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    padding: 4px 10px;
    font-size: 0.75rem;
    font-weight: 500;
    white-space: nowrap;
    background: var(--rp-gray-900);
    color: var(--rp-white);
    border-radius: var(--rp-radius-sm);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.15s ease, visibility 0.15s;
    pointer-events: none;
    z-index: 1200;
}

[data-tooltip]:hover::after {
    opacity: 1;
    visibility: visible;
}

/* ------------------------------------------------------------
   28. Notification Dot
   ------------------------------------------------------------ */
.notification-dot {
    position: relative;
}

.notification-dot::after {
    content: "";
    position: absolute;
    top: -2px;
    right: -2px;
    width: 8px;
    height: 8px;
    background: var(--rp-danger);
    border-radius: 50%;
    border: 2px solid var(--rp-white);
}

/* ------------------------------------------------------------
   29. Responsive Design
   ------------------------------------------------------------ */

/* Tablet - below 1024px */
@media (max-width: 1024px) {
    .rp-sidebar {
        transform: translateX(-100%);
    }

    .rp-sidebar.open {
        transform: translateX(0);
    }

    .rp-main {
        margin-left: 0;
    }

    .rp-sidebar-toggle {
        display: flex;
    }

    /* Overlay for sidebar */
    .sidebar-overlay {
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 999;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s ease, visibility 0.3s;
    }

    .sidebar-overlay.show {
        opacity: 1;
        visibility: visible;
    }

    .grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }

    .filter-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-bar .form-group {
        min-width: 100%;
    }
}

/* Mobile - below 768px */
@media (max-width: 768px) {
    body {
        font-size: 13px;
    }

    .rp-topbar {
        padding: 0 16px;
        height: 54px;
    }

    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
    }

    .form-row {
        flex-direction: column;
    }

    .form-row > .form-group {
        min-width: 100%;
    }

    .card-header {
        padding: 12px 16px;
        flex-direction: column;
        align-items: flex-start;
    }

    .card-body {
        padding: var(--rp-density-card-padding);
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .rp-table {
        font-size: 0.8125rem;
    }

    .rp-table thead th,
    .rp-table tbody td {
        padding: 8px 10px;
    }

    .stat-card {
        padding: var(--rp-density-card-padding);
    }

    .stat-value {
        font-size: 1.375rem;
    }

    .tab-nav {
        gap: 0;
    }

    .tab-btn {
        padding: 8px 12px;
        font-size: 0.8125rem;
    }

    /* Timeline compact on mobile */
    .timeline {
        padding-left: 24px;
    }

    .timeline::before {
        left: 7px;
    }

    .timeline-dot {
        left: -24px;
        width: 18px;
        height: 18px;
        font-size: 0.5625rem;
    }

    .timeline-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    .timeline-date {
        margin-left: 0;
    }

    /* Login card mobile */
    .login-card {
        padding: 28px 20px;
    }

    /* Pagination compact */
    .pagination {
        gap: 2px;
    }

    .page-link {
        min-width: 32px;
        height: 32px;
        font-size: 0.8125rem;
    }

    /* Hide user name on mobile */
    .user-name {
        display: none;
    }

    .btn-user {
        padding: 4px;
    }

    /* Modal mobile */
    .modal-overlay {
        padding: 16px;
        align-items: flex-end;
    }

    .modal {
        max-height: 85vh;
        border-radius: var(--rp-radius-lg) var(--rp-radius-lg) 0 0;
    }

    /* Subscription card */
    .subscription-card .subscription-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    /* Flash messages */
    .flash-container {
        left: 16px;
        right: 16px;
        max-width: none;
    }

    /* Language switcher */
    .lang-switcher {
        display: none;
    }

    /* Flex between stack on mobile */
    .flex-between-mobile-stack {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
}

/* Small mobile - below 480px */
@media (max-width: 480px) {
    .login-card {
        padding: 24px 16px;
    }

    .kb-search .form-control {
        padding: 10px 16px 10px 38px;
        font-size: 0.875rem;
    }

    .topbar-actions .btn span {
        display: none;
    }
}

/* ------------------------------------------------------------
   30. Print Styles
   ------------------------------------------------------------ */
@media print {
    .rp-sidebar,
    .rp-topbar,
    .sidebar-overlay,
    .flash-container,
    .modal-overlay,
    .btn,
    .filter-bar,
    .pagination {
        display: none !important;
    }

    .rp-main {
        margin-left: 0 !important;
    }

    .rp-content {
        padding: 0;
    }

    body {
        background: white;
        color: black;
        font-size: 12pt;
    }

    .card {
        box-shadow: none;
        border: 1px solid #ddd;
        page-break-inside: avoid;
    }

    .rp-table thead {
        background: #eee !important;
        color: black !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    a {
        color: black;
        text-decoration: underline;
    }

    a[href]::after {
        content: " (" attr(href) ")";
        font-size: 0.8em;
        color: #666;
    }
}

/* ------------------------------------------------------------
   31. Scrollbar (Global)
   ------------------------------------------------------------ */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--rp-gray-300);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--rp-gray-400);
}

/* Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--rp-gray-300) transparent;
}

/* ------------------------------------------------------------
   32. Transitions & Animations
   ------------------------------------------------------------ */
.fade-in {
    animation: fadeIn 0.3s ease;
}

.slide-up {
    animation: slideUp 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    html {
        scroll-behavior: auto;
    }
}

/* ------------------------------------------------------------
   33. Dark Mode (Optional - via class)
   ------------------------------------------------------------ */
/* ------------------------------------------------------------
   Topbar Icon Buttons (Search, Dark Mode)
   ------------------------------------------------------------ */
.btn-topbar-icon {
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    border-radius: var(--rp-radius-sm);
    color: var(--rp-gray-600);
    position: relative;
    transition: var(--rp-transition);
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-right: 4px;
}
.btn-topbar-icon:hover {
    background: var(--rp-gray-100);
    color: var(--rp-gray-900);
}
.search-shortcut {
    font-size: 0.7rem;
    color: var(--rp-gray-400);
    border: 1px solid var(--rp-gray-300);
    border-radius: 3px;
    padding: 1px 4px;
    font-family: inherit;
    line-height: 1.2;
}
.search-kbd {
    font-size: 0.7rem;
    color: var(--rp-gray-500);
    border: 1px solid var(--rp-gray-300);
    border-radius: 3px;
    padding: 2px 6px;
    background: var(--rp-gray-50);
    font-family: inherit;
}
.dark-mode .btn-topbar-icon { color: var(--rp-gray-300); }
.dark-mode .btn-topbar-icon:hover { background: rgba(255,255,255,0.1); color: #fff; }
.dark-mode .search-shortcut { color: var(--rp-gray-500); border-color: var(--rp-gray-600); }
.dark-mode .search-kbd { color: var(--rp-gray-400); border-color: var(--rp-gray-600); background: rgba(255,255,255,0.05); }

/* Dark mode icon toggle */
.dark-mode .icon-moon { display: none !important; }
.dark-mode .icon-sun { display: block !important; }

/* ------------------------------------------------------------
   Notification Bell
   ------------------------------------------------------------ */
.notif-bell {
    position: relative;
    margin-right: 8px;
}

.btn-notif {
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    border-radius: var(--rp-radius-sm);
    color: var(--rp-gray-600);
    position: relative;
    transition: var(--rp-transition);
}

.btn-notif:hover {
    background: var(--rp-gray-100);
    color: var(--rp-gray-900);
}

.notif-badge {
    position: absolute;
    top: 2px;
    right: 0;
    background: var(--rp-danger);
    color: white;
    font-size: 0.6875rem;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    line-height: 1;
}

.notif-dropdown {
    position: absolute;
    right: 0;
    top: 100%;
    margin-top: 8px;
    width: 380px;
    max-height: 480px;
    background: var(--rp-white);
    border: 1px solid var(--rp-gray-200);
    border-radius: var(--rp-radius);
    box-shadow: var(--rp-shadow-lg);
    z-index: 1000;
    display: flex;
    flex-direction: column;
}

.notif-dropdown-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid var(--rp-gray-200);
    font-size: 0.875rem;
}

.notif-mark-all {
    font-size: 0.75rem;
    color: var(--rp-orange);
    text-decoration: none;
}

.notif-mark-all:hover {
    text-decoration: underline;
}

.notif-dropdown-body {
    flex: 1;
    overflow-y: auto;
    max-height: 360px;
}

.notif-dropdown-footer {
    padding: 10px 16px;
    border-top: 1px solid var(--rp-gray-200);
    text-align: center;
}

.notif-dropdown-footer a {
    font-size: 0.8125rem;
    color: var(--rp-orange);
    text-decoration: none;
    font-weight: 500;
}

.notif-dropdown-footer a:hover {
    text-decoration: underline;
}

.notif-item {
    display: flex;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--rp-gray-100);
    cursor: pointer;
    transition: var(--rp-transition);
    text-decoration: none;
    color: inherit;
}

.notif-item:hover {
    background: var(--rp-gray-50);
}

.notif-item.unread {
    background: rgba(59, 130, 246, 0.04);
    border-left: 3px solid var(--rp-info);
}

.notif-item-icon {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--rp-gray-100);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--rp-gray-500);
}

.notif-item.unread .notif-item-icon {
    background: rgba(59, 130, 246, 0.1);
    color: var(--rp-info);
}

.notif-item-content {
    flex: 1;
    min-width: 0;
}

.notif-item-title {
    font-size: 0.8125rem;
    line-height: 1.4;
    margin-bottom: 2px;
}

.notif-item.unread .notif-item-title {
    font-weight: 600;
}

.notif-item-body {
    font-size: 0.75rem;
    color: var(--rp-gray-500);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.notif-item-time {
    font-size: 0.6875rem;
    color: var(--rp-gray-400);
    margin-top: 4px;
}

.notif-empty {
    padding: 32px 16px;
    text-align: center;
    color: var(--rp-gray-400);
    font-size: 0.875rem;
}

/* Notification list page */
.notif-page-item {
    display: flex;
    gap: 16px;
    padding: 16px;
    border-bottom: 1px solid var(--rp-gray-100);
    cursor: pointer;
    transition: var(--rp-transition);
}

.notif-page-item:hover {
    background: var(--rp-gray-50);
}

.notif-page-item.unread {
    background: rgba(59, 130, 246, 0.04);
    border-left: 3px solid var(--rp-info);
}

/* ------------------------------------------------------------
   CSAT Star Rating
   ------------------------------------------------------------ */
.csat-card {
    background: var(--rp-gray-50);
    border: 1px solid var(--rp-gray-200);
    border-radius: var(--rp-radius);
    padding: 24px;
    text-align: center;
}

.csat-stars {
    display: inline-flex;
    gap: 4px;
    cursor: pointer;
}

.csat-star {
    width: 32px;
    height: 32px;
    color: var(--rp-gray-300);
    transition: color 0.15s ease;
}

.csat-star.filled {
    color: #f59e0b;
}

.csat-star:hover,
.csat-stars:hover .csat-star {
    color: #f59e0b;
}

.csat-stars:hover .csat-star:hover ~ .csat-star {
    color: var(--rp-gray-300);
}

.csat-stars-readonly {
    display: inline-flex;
    gap: 2px;
    pointer-events: none;
}

.csat-stars-readonly .csat-star.filled {
    color: #f59e0b;
}

.csat-label {
    font-size: 0.75rem;
    color: var(--rp-gray-500);
    margin-top: 4px;
}

.csat-feedback {
    width: 100%;
    max-width: 400px;
    margin: 12px auto 0;
}

/* News cards */
.news-card {
    display: block;
    padding: 16px;
    border: 1px solid var(--rp-gray-200);
    border-radius: var(--rp-radius);
    margin-bottom: 12px;
    text-decoration: none;
    color: inherit;
    transition: var(--rp-transition);
}

.news-card:hover {
    border-color: var(--rp-orange);
    box-shadow: var(--rp-shadow);
}

.news-card.unread {
    border-left: 4px solid var(--rp-orange);
}

/* ============================================================
   Canned Responses Picker
   ============================================================ */
.canned-picker {
    position: relative;
    display: inline-block;
}

.canned-dropdown {
    position: absolute;
    bottom: 100%;
    left: 0;
    width: 360px;
    max-height: 320px;
    background: #fff;
    border: 1px solid var(--rp-gray-200);
    border-radius: var(--rp-radius);
    box-shadow: var(--rp-shadow-lg);
    z-index: 100;
    display: flex;
    flex-direction: column;
}

.canned-dropdown-header {
    padding: 10px 12px;
    border-bottom: 1px solid var(--rp-gray-200);
}

.canned-dropdown-header input {
    width: 100%;
    padding: 6px 10px;
    border: 1px solid var(--rp-gray-300);
    border-radius: var(--rp-radius);
    font-size: 0.85em;
}

.canned-dropdown-body {
    overflow-y: auto;
    flex: 1;
    max-height: 240px;
}

.canned-item {
    display: block;
    padding: 10px 12px;
    border-bottom: 1px solid var(--rp-gray-100);
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    transition: background 0.15s;
}

.canned-item:hover {
    background: var(--rp-gray-50);
}

.canned-item-title {
    font-weight: 600;
    font-size: 0.9em;
    margin-bottom: 2px;
}

.canned-item-preview {
    font-size: 0.8em;
    color: var(--rp-gray-500);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.canned-item-meta {
    font-size: 0.75em;
    color: var(--rp-gray-400);
    margin-top: 2px;
}

/* ============================================================
   Bulk Operations Toolbar
   ============================================================ */
.bulk-toolbar {
    display: none;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    background: var(--rp-navy);
    color: #fff;
    border-radius: var(--rp-radius);
    margin-bottom: 12px;
    flex-wrap: wrap;
    position: sticky;
    top: 0;
    z-index: 50;
}

.bulk-toolbar.active {
    display: flex;
}

.bulk-toolbar .bulk-count {
    font-weight: 600;
    white-space: nowrap;
}

.bulk-toolbar select {
    padding: 4px 8px;
    border-radius: var(--rp-radius);
    border: 1px solid rgba(255,255,255,0.3);
    background: rgba(255,255,255,0.1);
    color: #fff;
    font-size: 0.85em;
}

.bulk-toolbar select option {
    color: #000;
    background: #fff;
}

.bulk-toolbar .btn {
    padding: 4px 12px;
    font-size: 0.85em;
}

.bulk-toolbar .btn-bulk-apply {
    background: var(--rp-orange);
    color: #fff;
    border: none;
    border-radius: var(--rp-radius);
    padding: 5px 14px;
    font-weight: 600;
    cursor: pointer;
}

.bulk-toolbar .btn-bulk-apply:hover {
    background: var(--rp-orange-hover);
}

.bulk-toolbar .btn-bulk-cancel {
    background: transparent;
    color: rgba(255,255,255,0.8);
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: var(--rp-radius);
    padding: 4px 12px;
    cursor: pointer;
}

.bulk-toolbar .btn-bulk-cancel:hover {
    color: #fff;
    border-color: #fff;
}

/* Dark mode overrides for bulk toolbar */
.dark-mode .bulk-toolbar select {
    background-color: rgba(255,255,255,0.08);
    border-color: rgba(255,255,255,0.2);
    color: #e5e7eb;
}
.dark-mode .bulk-toolbar select option {
    background-color: #1a1f2e;
    color: #e5e7eb;
}

.bulk-checkbox {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: var(--rp-orange);
}

/* ============================================================
   Ticket Tags
   ============================================================ */
.tag-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 0.75em;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    line-height: 1.6;
}

.tag-pill-sm {
    padding: 1px 7px;
    font-size: 0.7em;
}

.tag-pill .tag-remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: rgba(0,0,0,0.2);
    color: #fff;
    border: none;
    cursor: pointer;
    font-size: 10px;
    line-height: 1;
    padding: 0;
    margin-left: 2px;
}

.tag-pill .tag-remove:hover {
    background: rgba(0,0,0,0.4);
}

.tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    align-items: center;
}

.tag-add-btn {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75em;
    border: 1px dashed var(--rp-gray-400);
    color: var(--rp-gray-500);
    background: transparent;
    cursor: pointer;
    white-space: nowrap;
}

.tag-add-btn:hover {
    border-color: var(--rp-orange);
    color: var(--rp-orange);
}

.tag-picker {
    position: absolute;
    top: 100%;
    left: 0;
    width: 220px;
    background: #fff;
    border: 1px solid var(--rp-gray-200);
    border-radius: var(--rp-radius);
    box-shadow: var(--rp-shadow-lg);
    z-index: 100;
    padding: 8px;
}

.tag-picker input {
    width: 100%;
    padding: 5px 8px;
    border: 1px solid var(--rp-gray-300);
    border-radius: var(--rp-radius);
    font-size: 0.85em;
    margin-bottom: 6px;
    box-sizing: border-box;
}

.tag-picker-list {
    max-height: 150px;
    overflow-y: auto;
}

.tag-picker-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 6px;
    cursor: pointer;
    border-radius: 4px;
    font-size: 0.85em;
}

.tag-picker-item:hover {
    background: var(--rp-gray-50);
}

.tag-picker-item .tag-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* Tag management page */
.tag-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 8px 0;
}

.tag-card {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: var(--rp-gray-50);
    border: 1px solid var(--rp-gray-200);
    border-radius: var(--rp-radius);
}

.tag-card .tag-count {
    font-size: 0.8em;
    color: var(--rp-gray-500);
}

/* ---- Workload Dashboard ---- */
.workload-bar {
    display: flex;
    align-items: center;
    gap: 8px;
}
.workload-bar-track {
    flex: 1;
    background: var(--rp-gray-200);
    border-radius: 4px;
    height: 20px;
    overflow: hidden;
}
.workload-bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.3s ease;
    min-width: 2px;
}
.workload-bar-fill.load-low    { background: var(--rp-success); }
.workload-bar-fill.load-medium { background: var(--rp-warning); }
.workload-bar-fill.load-high   { background: var(--rp-danger); }
.workload-count {
    font-weight: 700;
    min-width: 30px;
    text-align: right;
}

/* ---- Escalation badge ---- */
.badge-escalated {
    background-color: #9333ea;
    color: #fff;
}

/* ============================================================
   Dark Mode - Complete Theme
   ============================================================ */
.dark-mode {
    --rp-gray-50: #1a1f2e;
    --rp-gray-100: #1f2937;
    --rp-gray-200: #374151;
    --rp-gray-300: #4b5563;
    --rp-gray-400: #6b7280;
    --rp-gray-500: #9ca3af;
    --rp-gray-600: #d1d5db;
    --rp-gray-700: #e5e7eb;
    --rp-gray-800: #f3f4f6;
    --rp-gray-900: #f9fafb;
    --rp-white: #1a1f2e;

    /* Deeper shadows for dark mode */
    --rp-shadow: 0 1px 3px rgba(0, 0, 0, 0.3), 0 1px 2px rgba(0, 0, 0, 0.2);
    --rp-shadow-md: 0 4px 6px rgba(0, 0, 0, 0.3), 0 2px 4px rgba(0, 0, 0, 0.2);
    --rp-shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.3), 0 4px 6px rgba(0, 0, 0, 0.2);
    --rp-shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.4), 0 8px 10px rgba(0, 0, 0, 0.25);

    /* Focus ring for dark mode */
    --rp-focus-ring: 0 0 0 2px #1a1f2e, 0 0 0 4px var(--rp-orange);
}

.dark-mode body {
    background-color: #0f1219;
    color: #e5e7eb;
}

/* Cards, stat cards, modal, filter bar */
.dark-mode .card,
.dark-mode .stat-card,
.dark-mode .modal {
    background-color: #1a1f2e;
    border-color: #2d3548;
}
.dark-mode .filter-bar {
    background-color: #1a1f2e;
    border: 1px solid #2d3548;
    border-radius: var(--rp-radius);
}

/* Topbar glass effect in dark mode */
.dark-mode .rp-topbar {
    background: rgba(26, 31, 46, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-color: #2d3548;
}

.dark-mode .card-header { border-bottom-color: #2d3548; }

/* Sidebar - boost contrast in dark mode */
.dark-mode .rp-sidebar {
    background: #0a0f1a;
    border-right: 1px solid #1e2636;
}
.dark-mode .rp-logo {
    border-bottom-color: #1e2636;
}
.dark-mode .rp-logo-text {
    color: #f9fafb;
}
.dark-mode .logo-icon {
    color: #f9fafb;
}
.dark-mode .rp-nav-section {
    color: #9ca3af;
}
.dark-mode .rp-nav-item {
    color: #d1d5db;
}
.dark-mode .rp-nav-item:hover {
    color: #f9fafb;
    background: rgba(255, 255, 255, 0.08);
}
.dark-mode .rp-nav-item.active {
    color: var(--rp-orange);
    background: rgba(255, 122, 0, 0.12);
}
.dark-mode .rp-nav-item .nav-icon {
    opacity: 0.85;
}
.dark-mode .rp-nav-item.active .nav-icon {
    opacity: 1;
}
.dark-mode .sidebar-collapse-btn {
    color: #9ca3af;
}
.dark-mode .sidebar-collapse-btn:hover {
    color: #f9fafb;
    background: rgba(255, 255, 255, 0.08);
}
.dark-mode .rp-sidebar::-webkit-scrollbar-thumb {
    background: #374151;
}
.dark-mode .card-footer { border-top-color: #2d3548; background: #141821; }

/* Forms */
.dark-mode .form-control {
    background-color: #141821;
    border-color: #374151;
    color: #e5e7eb;
}
.dark-mode .form-control:focus {
    border-color: var(--rp-orange);
    box-shadow: var(--rp-focus-ring);
}
.dark-mode .form-label { color: #d1d5db; }
.dark-mode .form-label-sm { color: #9ca3af; }
.dark-mode .form-actions { border-top-color: #2d3548; }
.dark-mode .form-file-label {
    background-color: #141821;
    border-color: #374151;
    color: #9ca3af;
}
.dark-mode .form-file-label:hover { background-color: #1f2937; }
.dark-mode select,
.dark-mode select.form-control {
    background-color: #141821;
    border: 1px solid #374151;
    color: #e5e7eb;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%239ca3af' d='M6 8.825L1.175 4l.85-.85L6 7.15l3.975-3.975.85.825L6 8.825z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 12px;
}
.dark-mode select option,
.dark-mode select.form-control option {
    background-color: #1a1f2e;
    color: #e5e7eb;
}
.dark-mode .form-control:disabled,
.dark-mode .form-control[readonly] {
    background-color: #1f2937;
    color: #6b7280;
    border-color: #374151;
}
.dark-mode .filter-bar .form-control {
    background-color: #141821;
    border: 1px solid #374151;
    color: #e5e7eb;
}

/* Tables */
.dark-mode .rp-table thead {
    background: #1e2636;
    border-bottom: 2px solid #374151;
}
.dark-mode .rp-table thead th {
    color: #d1d5db;
    border-bottom-color: #374151;
}
.dark-mode .rp-table thead th a { color: #d1d5db; }
.dark-mode .rp-table thead th a:hover { color: var(--rp-orange-light); }
.dark-mode .rp-table tbody tr:nth-child(even) {
    background: rgba(255, 255, 255, 0.02);
}
.dark-mode .rp-table tbody tr:hover {
    background: rgba(255, 122, 0, 0.05);
}
.dark-mode .rp-table tbody td { color: #d1d5db; }
.dark-mode .rp-table tbody td { border-bottom-color: #2d3548; }
.dark-mode .table-responsive { border-color: #2d3548; }

/* Badges - use slightly transparent backgrounds */
.dark-mode .badge-primary { background: rgba(255, 122, 0, 0.15); }
.dark-mode .badge-success { background: rgba(16, 185, 129, 0.15); }
.dark-mode .badge-warning { background: rgba(245, 158, 11, 0.15); }
.dark-mode .badge-danger { background: rgba(239, 68, 68, 0.15); }
.dark-mode .badge-info { background: rgba(59, 130, 246, 0.15); }
.dark-mode .badge-default { background: rgba(255, 255, 255, 0.08); }
.dark-mode .badge-secondary { background: rgba(255, 255, 255, 0.1); }

/* Alerts */
.dark-mode .alert-success { background: rgba(16, 185, 129, 0.1); border-color: rgba(16, 185, 129, 0.3); }
.dark-mode .alert-error { background: rgba(239, 68, 68, 0.1); border-color: rgba(239, 68, 68, 0.3); }
.dark-mode .alert-warning { background: rgba(245, 158, 11, 0.1); border-color: rgba(245, 158, 11, 0.3); }
.dark-mode .alert-info { background: rgba(59, 130, 246, 0.1); border-color: rgba(59, 130, 246, 0.3); }

/* Flash messages */
.dark-mode .flash-message.flash-success { background: rgba(16, 185, 129, 0.15); border-color: rgba(16, 185, 129, 0.3); }
.dark-mode .flash-message.flash-error { background: rgba(239, 68, 68, 0.15); border-color: rgba(239, 68, 68, 0.3); }
.dark-mode .flash-message.flash-warning { background: rgba(245, 158, 11, 0.15); border-color: rgba(245, 158, 11, 0.3); }
.dark-mode .flash-message.flash-info { background: rgba(59, 130, 246, 0.15); border-color: rgba(59, 130, 246, 0.3); }

/* Buttons */
.dark-mode .btn-secondary {
    background: #2d3548;
    color: #e5e7eb;
    border-color: #374151;
}
.dark-mode .btn-secondary:hover { background: #374151; }
.dark-mode .btn-ghost:hover { background: #2d3548; }
.dark-mode .btn-outline-secondary {
    color: #d1d5db;
    border-color: #4b5563;
}
.dark-mode .btn-outline-secondary:hover { background: #2d3548; }

/* User menu */
.dark-mode .btn-user { border-color: #374151; }
.dark-mode .btn-user:hover { background: #2d3548; }
.dark-mode .user-name { color: #d1d5db; }
.dark-mode .user-dropdown { background: #1a1f2e; border-color: #2d3548; }
.dark-mode .dropdown-header { border-bottom-color: #2d3548; }
.dark-mode .dropdown-header .dropdown-user-name { color: #e5e7eb; }
.dark-mode .dropdown-header .dropdown-user-role,
.dark-mode .dropdown-header .dropdown-user-email { color: #9ca3af; }
.dark-mode .dropdown-divider { background: #2d3548; }
.dark-mode .dropdown-item { color: #d1d5db; }
.dark-mode .dropdown-item:hover { background: #2d3548; }
.dark-mode .dropdown-item.danger:hover { background: rgba(239, 68, 68, 0.1); }

/* Language switcher */
.dark-mode .lang-switcher { background: #2d3548; }
.dark-mode .lang-btn { color: #9ca3af; }
.dark-mode .lang-btn.active { background: #1a1f2e; color: #f3f4f6; }

/* Notification dropdown */
.dark-mode .notif-dropdown { background: #1a1f2e; border-color: #2d3548; }
.dark-mode .notif-dropdown-header { border-bottom-color: #2d3548; }
.dark-mode .notif-dropdown-footer { border-top-color: #2d3548; }
.dark-mode .notif-item { border-bottom-color: #2d3548; }
.dark-mode .notif-item:hover { background: #2d3548; }
.dark-mode .notif-item.unread { background: rgba(255, 122, 0, 0.05); border-left-color: var(--rp-orange); }
.dark-mode .notif-item-icon { background: #2d3548; }

/* Tabs */
.dark-mode .tab-nav { border-bottom-color: #2d3548; }
.dark-mode .tab-nav.tab-pills { background: #141821; }
.dark-mode .tab-nav.tab-pills .tab-btn.active { background: #1a1f2e; color: #f3f4f6; }

/* Timeline */
.dark-mode .timeline::before { background: #2d3548; }
.dark-mode .timeline-dot { background: #1a1f2e; border-color: #4b5563; }
.dark-mode .timeline-body { background: #141821; border-color: #2d3548; }
.dark-mode .timeline-attachment { background: #1a1f2e; border-color: #2d3548; }

/* Pagination */
.dark-mode .page-link { background: #1a1f2e; border-color: #2d3548; color: #d1d5db; }
.dark-mode .page-link:hover { background: #2d3548; }

/* Tooltip */
.dark-mode [data-tooltip]::after { background: #f3f4f6; color: #111827; }

/* Scrollbar */
.dark-mode ::-webkit-scrollbar-thumb { background: #374151; }
.dark-mode ::-webkit-scrollbar-thumb:hover { background: #4b5563; }

/* Modals */
.dark-mode .modal-overlay { background: rgba(0, 0, 0, 0.7); }
.dark-mode .modal-header { border-bottom-color: #2d3548; }
.dark-mode .modal-footer { border-top-color: #2d3548; background: #141821; }
.dark-mode .modal-close { color: #6b7280; }
.dark-mode .modal-close:hover { background: #2d3548; color: #e5e7eb; }

/* Confirm dialog */
.dark-mode .modal-confirm .confirm-icon.icon-danger { background: rgba(239, 68, 68, 0.15); }
.dark-mode .modal-confirm .confirm-icon.icon-warning { background: rgba(245, 158, 11, 0.15); }

/* SLA badges */
.dark-mode .sla-ok { background: rgba(16, 185, 129, 0.15); }
.dark-mode .sla-warning { background: rgba(245, 158, 11, 0.15); }
.dark-mode .sla-breached { background: rgba(239, 68, 68, 0.15); }

/* Quick actions */
.dark-mode .quick-action-btn { background: #1a1f2e; border-color: #2d3548; color: #d1d5db; }
.dark-mode .quick-action-btn:hover { border-color: var(--rp-orange); color: var(--rp-orange); }

/* Status donut center */
.dark-mode .status-donut::after { background: #1a1f2e; }

/* Activity feed */
.dark-mode .activity-feed-item { border-bottom-color: #2d3548; }

/* KB cards */
.dark-mode .kb-card { background: #1a1f2e; border-color: #2d3548; }
.dark-mode .kb-card:hover { border-color: var(--rp-orange-light); }
.dark-mode .kb-category-card { background: #1a1f2e; border-color: #2d3548; }
.dark-mode .kb-category-card .kb-category-icon { background: rgba(255, 122, 0, 0.15); }

/* FAQ */
.dark-mode .faq-item { background: #1a1f2e; border-color: #2d3548; }
.dark-mode .faq-item.open { border-color: var(--rp-orange-light); }

/* News cards */
.dark-mode .news-card { border-color: #2d3548; }
.dark-mode .news-card:hover { border-color: var(--rp-orange); }

/* Canned picker */
.dark-mode .canned-dropdown { background: #1a1f2e; border-color: #2d3548; }
.dark-mode .canned-dropdown-header { border-bottom-color: #2d3548; }
.dark-mode .canned-dropdown-header input { background-color: #141821; border-color: #374151; color: #e5e7eb; }
.dark-mode .canned-item { border-bottom-color: #2d3548; }
.dark-mode .canned-item:hover { background: #2d3548; }

/* Subscription cards */
.dark-mode .subscription-card { background: #1a1f2e; border-color: #2d3548; }

/* Tag picker */
.dark-mode .tag-picker { background: #1a1f2e; border-color: #2d3548; }
.dark-mode .tag-picker input { background-color: #141821; border-color: #374151; color: #e5e7eb; }
.dark-mode .tag-picker-item:hover { background: #2d3548; }
.dark-mode .tag-card { background: #141821; border-color: #2d3548; }

/* Bulk toolbar - already dark */

/* Skeleton loader */
.dark-mode .skeleton {
    background: linear-gradient(90deg, #1f2937 25%, #2d3548 50%, #1f2937 75%);
    background-size: 200% 100%;
}

/* Quill editor */
.dark-mode .quill-editor { background: #141821; }
.dark-mode .quill-editor .ql-editor { color: #e5e7eb; }
.dark-mode .ql-toolbar.ql-snow { background: #1a1f2e; border-color: #374151 !important; }
.dark-mode .ql-container.ql-snow { border-color: #374151 !important; }
.dark-mode .ql-toolbar .ql-stroke { stroke: #9ca3af; }
.dark-mode .ql-toolbar .ql-fill { fill: #9ca3af; }
.dark-mode .ql-toolbar .ql-picker-label { color: #9ca3af; }

/* Login page */
.dark-mode .login-card { background: #1a1f2e; }
.dark-mode .login-error { background: rgba(239, 68, 68, 0.15); border-color: rgba(239, 68, 68, 0.3); }

/* CSAT */
.dark-mode .csat-card { background: #141821; border-color: #2d3548; }

/* Divider */
.dark-mode .divider { background: #2d3548; }
.dark-mode .border-top { border-top-color: #2d3548; }
.dark-mode .border-bottom { border-bottom-color: #2d3548; }

/* Empty state */
.dark-mode .empty-state .empty-icon { background: #2d3548; }

/* Date range picker */
.dark-mode .date-range-picker input[type="date"] { background-color: #141821; border-color: #374151; color: #e5e7eb; }

/* Print: force light mode — reset full gray scale so dark-mode text prints visible */
@media print {
    .dark-mode {
        --rp-white: #ffffff;
        --rp-gray-50: #f9fafb;
        --rp-gray-100: #f3f4f6;
        --rp-gray-200: #e5e7eb;
        --rp-gray-300: #d1d5db;
        --rp-gray-400: #9ca3af;
        --rp-gray-500: #6b7280;
        --rp-gray-600: #4b5563;
        --rp-gray-700: #374151;
        --rp-gray-800: #1f2937;
        --rp-gray-900: #111827;
    }
    .dark-mode,
    .dark-mode body {
        background: #fff !important;
        color: #000 !important;
    }
    .dark-mode .card {
        background: #fff !important;
        color: #000 !important;
    }
    .dark-mode .rp-table thead {
        background: #eee !important;
        color: #000 !important;
    }
    .dark-mode .rp-table td,
    .dark-mode .rp-table th {
        color: #000 !important;
    }
}

/* ============================================================
   Phase 4: Quill Editor Integration
   ============================================================ */
.quill-editor {
    background: var(--rp-white);
    border-radius: 0 0 var(--rp-radius) var(--rp-radius);
    min-height: 200px;
}
.quill-editor .ql-editor {
    min-height: 180px;
    font-family: var(--rp-font-family);
    font-size: 0.9375rem;
    line-height: 1.8;
    color: var(--rp-gray-700);
}
.ql-toolbar.ql-snow {
    border-color: var(--rp-gray-300) !important;
    border-radius: var(--rp-radius) var(--rp-radius) 0 0;
    background: var(--rp-gray-50);
}
.ql-container.ql-snow {
    border-color: var(--rp-gray-300) !important;
    border-radius: 0 0 var(--rp-radius) var(--rp-radius);
}
.ql-editor:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(255, 122, 0, 0.15);
}

/* ============================================================
   Phase 4: Quick Actions Bar
   ============================================================ */
.quick-actions {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}
.quick-action-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 24px;
    background: var(--rp-white);
    border: 2px solid var(--rp-gray-200);
    border-radius: var(--rp-radius-lg);
    color: var(--rp-gray-700);
    font-weight: 600;
    font-size: 0.9375rem;
    text-decoration: none;
    transition: var(--rp-transition);
    cursor: pointer;
    flex: 1;
    min-width: 180px;
    justify-content: center;
}
.quick-action-btn:hover {
    border-color: var(--rp-orange);
    color: var(--rp-orange);
    text-decoration: none;
    box-shadow: var(--rp-shadow-md);
    transform: translateY(-1px);
}
.quick-action-btn.quick-action-primary {
    background: var(--rp-orange);
    border-color: var(--rp-orange);
    color: var(--rp-white);
}
.quick-action-btn.quick-action-primary:hover {
    background: var(--rp-orange-dark);
    border-color: var(--rp-orange-dark);
    color: var(--rp-white);
}

/* ============================================================
   Phase 4: Status Donut (CSS-only)
   ============================================================ */
.status-donut-container {
    display: flex;
    align-items: center;
    gap: 32px;
    flex-wrap: wrap;
}
.status-donut {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    position: relative;
    flex-shrink: 0;
}
.status-donut::after {
    content: '';
    position: absolute;
    top: 30%;
    left: 30%;
    width: 40%;
    height: 40%;
    background: var(--rp-white);
    border-radius: 50%;
}
.status-donut-legend {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.status-donut-legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.875rem;
}
.status-donut-legend-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* ============================================================
   Phase 4: Activity Feed
   ============================================================ */
.activity-feed-item {
    display: flex;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--rp-gray-100);
    align-items: flex-start;
}
.activity-feed-item:last-child {
    border-bottom: none;
}
.activity-feed-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--rp-white);
    font-size: 0.75rem;
}
.activity-feed-icon.activity-comment { background: var(--rp-info); }
.activity-feed-icon.activity-status  { background: var(--rp-warning); }
.activity-feed-body { flex: 1; min-width: 0; }
.activity-feed-body a { font-weight: 600; }
.activity-feed-time { font-size: 0.8125rem; color: var(--rp-gray-400); }

/* ============================================================
   Phase 4: Report Charts
   ============================================================ */
.chart-container {
    position: relative;
    height: 300px;
    width: 100%;
}
.chart-container canvas { max-height: 300px; }
.date-range-picker {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.date-range-picker input[type="date"] {
    padding: 8px 12px;
    border: 1px solid var(--rp-gray-300);
    border-radius: var(--rp-radius);
    font-family: var(--rp-font-family);
    font-size: 0.875rem;
}
.date-preset-btns { display: flex; gap: 4px; }
.date-preset-btns .btn { padding: 6px 12px; font-size: 0.8125rem; }

/* ============================================================
   Additional Utility Classes
   ============================================================ */
.items-start { align-items: flex-start; }
.justify-center { justify-content: center; }
.text-2xl { font-size: 2em; }
.text-capitalize { text-transform: capitalize; }
.lh-tight { line-height: 1.3; }
.ws-nowrap { white-space: nowrap; }
.px-0 { padding-left: 0; padding-right: 0; }
.pt-2 { padding-top: 8px; }
.pb-0 { padding-bottom: 0; }
.max-w-600 { max-width: 600px; }
.border-none { border: none; }
.cursor-default { cursor: default; }
.d-block { display: block; }

/* Card accent borders */
.card-accent-top { border-top: 4px solid var(--accent-color, var(--rp-orange)); }
.card-accent-left { border-left: 4px solid var(--accent-color, var(--rp-orange)); }
.card-accent-blue { border-top: 4px solid var(--rp-info); }
.card-accent-green { border-top: 4px solid var(--rp-success); }
.card-accent-orange { border-top: 4px solid var(--rp-orange); }
.card-accent-red { border-top: 4px solid var(--rp-danger); }

/* ============================================================
   Collapsible Sidebar
   ============================================================ */
:root {
    --rp-sidebar-collapsed-width: 64px;
}

.rp-sidebar {
    transition: width 0.3s ease;
}

.rp-sidebar.collapsed {
    width: var(--rp-sidebar-collapsed-width);
}

.rp-sidebar.collapsed .rp-logo-text {
    display: none;
}

.rp-sidebar.collapsed .rp-nav-section {
    font-size: 0;
    padding: 12px 0 4px;
    text-align: center;
}

.rp-sidebar.collapsed .rp-nav-section::after {
    content: '';
    display: block;
    width: 24px;
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: 0 auto;
}

.rp-sidebar.collapsed .rp-nav-item {
    justify-content: center;
    padding: 12px 0;
    gap: 0;
    border-left-width: 0;
}

.rp-sidebar.collapsed .rp-nav-item .nav-label {
    display: none;
}

.rp-sidebar.collapsed .rp-nav-item .nav-badge {
    position: absolute;
    top: 4px;
    right: 8px;
    min-width: 16px;
    height: 16px;
    font-size: 0.5625rem;
    padding: 0 4px;
}

.rp-sidebar.collapsed .rp-nav-item .nav-icon {
    opacity: 0.85;
}

.rp-sidebar.collapsed .rp-nav-item.active .nav-icon {
    opacity: 1;
}

.rp-sidebar.collapsed .rp-sidebar-footer .sidebar-user-name,
.rp-sidebar.collapsed .rp-sidebar-footer .sidebar-user-role {
    display: none;
}

.rp-sidebar.collapsed + .sidebar-overlay + .rp-main,
.rp-sidebar.collapsed ~ .rp-main {
    margin-left: var(--rp-sidebar-collapsed-width);
}

/* Sidebar collapse toggle button */
.sidebar-collapse-btn {
    background: none;
    border: none;
    color: var(--rp-gray-400);
    cursor: pointer;
    padding: 6px;
    border-radius: var(--rp-radius-sm);
    transition: var(--rp-transition);
    margin-left: auto;
    display: flex;
    align-items: center;
}

.sidebar-collapse-btn:hover {
    color: var(--rp-white);
    background: rgba(255, 255, 255, 0.08);
}

.sidebar-collapse-btn svg {
    transition: transform 0.3s ease;
}

.rp-sidebar.collapsed .sidebar-collapse-btn {
    margin: 0 auto;
}

.rp-sidebar.collapsed .sidebar-collapse-btn svg {
    transform: rotate(180deg);
}

/* Tooltip for collapsed sidebar items */
.rp-sidebar.collapsed .rp-nav-item[data-tooltip]::after {
    left: calc(100% + 8px);
    top: 50%;
    bottom: auto;
    transform: translateY(-50%);
    white-space: nowrap;
}

/* Hide sidebar collapse on mobile (use full toggle instead) */
@media (max-width: 1024px) {
    .sidebar-collapse-btn { display: none; }
    .rp-sidebar.collapsed { width: var(--rp-sidebar-width); }
    .rp-sidebar.collapsed .rp-logo-text { display: block; }
    .rp-sidebar.collapsed .rp-nav-section { font-size: 0.6875rem; padding: 16px 20px 6px; text-align: left; }
    .rp-sidebar.collapsed .rp-nav-section::after { display: none; }
    .rp-sidebar.collapsed .rp-nav-item { justify-content: flex-start; padding: 10px 20px; gap: 12px; border-left-width: 3px; }
    .rp-sidebar.collapsed .rp-nav-item .nav-label { display: inline; }
    .rp-sidebar.collapsed .rp-nav-item .nav-badge { position: static; min-width: 20px; height: auto; font-size: 0.6875rem; padding: 2px 8px; }
}

/* ============================================================
   Global Search (Cmd+K)
   ============================================================ */
.global-search-modal .modal {
    max-width: 640px;
    max-height: 480px;
}

.global-search-modal .modal-body {
    padding: 0;
}

.global-search-wrapper {
    position: relative;
}

.global-search-input {
    display: block;
    width: 100%;
    padding: 16px 20px 16px 48px;
    font-size: 1.0625rem;
    border: none;
    border-bottom: 1px solid var(--rp-gray-200);
    background: transparent;
    color: inherit;
    font-family: var(--rp-font-family);
    outline: none;
}

.global-search-input::placeholder {
    color: var(--rp-gray-400);
}

.global-search-icon {
    position: absolute;
    left: 18px;
    top: 17px;
    color: var(--rp-gray-400);
    pointer-events: none;
}

.global-search-results {
    max-height: 380px;
    overflow-y: auto;
    padding: 8px 0;
}

.search-result-group {
    padding: 4px 0;
}

.search-result-group-label {
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--rp-gray-400);
    padding: 8px 20px 4px;
}

.search-result-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 20px;
    color: inherit;
    text-decoration: none;
    transition: background 0.1s;
    cursor: pointer;
}

.search-result-item:hover {
    background: var(--rp-gray-50);
    text-decoration: none;
}

.search-result-item .result-icon {
    width: 32px;
    height: 32px;
    border-radius: var(--rp-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--rp-white);
}

.search-result-item .result-icon.icon-ticket { background: var(--rp-info); }
.search-result-item .result-icon.icon-article { background: var(--rp-success); }
.search-result-item .result-icon.icon-user { background: var(--rp-orange); }

.search-result-item .result-title {
    font-weight: 500;
    font-size: 0.875rem;
}

.search-result-item .result-subtitle {
    font-size: 0.75rem;
    color: var(--rp-gray-500);
}

.search-result-empty {
    text-align: center;
    padding: 32px 20px;
    color: var(--rp-gray-400);
    font-size: 0.875rem;
}

.search-shortcut-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 6px;
    font-size: 0.6875rem;
    font-weight: 600;
    background: var(--rp-gray-100);
    border: 1px solid var(--rp-gray-200);
    border-radius: var(--rp-radius-sm);
    color: var(--rp-gray-500);
    font-family: var(--rp-font-mono);
}

/* ============================================================
   File Upload Component
   ============================================================ */
.file-upload-zone {
    border: 2px dashed var(--rp-gray-300);
    border-radius: var(--rp-radius);
    padding: 24px;
    text-align: center;
    cursor: pointer;
    transition: var(--rp-transition);
    background: var(--rp-gray-50);
}
.file-upload-zone:hover,
.file-upload-zone.dragover {
    border-color: var(--rp-orange);
    background: rgba(255, 122, 0, 0.04);
}
.file-upload-zone .upload-icon {
    width: 36px;
    height: 36px;
    margin: 0 auto 8px;
    color: var(--rp-gray-400);
}
.file-upload-zone.dragover .upload-icon {
    color: var(--rp-orange);
}
.file-upload-zone .upload-text {
    font-size: 0.875rem;
    color: var(--rp-gray-600);
    margin-bottom: 4px;
}
.file-upload-zone .upload-text strong {
    color: var(--rp-orange);
}
.file-upload-zone .upload-hint {
    font-size: 0.75rem;
    color: var(--rp-gray-400);
}
.file-upload-zone input[type="file"] {
    display: none;
}

.file-preview-list {
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.file-preview-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border: 1px solid var(--rp-gray-200);
    border-radius: var(--rp-radius);
    background: var(--rp-white);
    font-size: 0.8125rem;
}
.file-preview-item .file-icon {
    width: 28px;
    height: 28px;
    border-radius: var(--rp-radius-sm);
    overflow: hidden;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--rp-gray-100);
    color: var(--rp-gray-500);
    font-size: 0.625rem;
    font-weight: 700;
    text-transform: uppercase;
}
.file-preview-item .file-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.file-preview-item .file-info {
    flex: 1;
    min-width: 0;
}
.file-preview-item .file-name {
    font-weight: 500;
    color: var(--rp-gray-800);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.file-preview-item .file-size {
    color: var(--rp-gray-400);
    font-size: 0.75rem;
}
.file-preview-item .file-remove {
    flex-shrink: 0;
    background: none;
    border: none;
    color: var(--rp-gray-400);
    cursor: pointer;
    padding: 4px;
    border-radius: var(--rp-radius-sm);
    transition: var(--rp-transition);
    line-height: 1;
}
.file-preview-item .file-remove:hover {
    color: var(--rp-danger);
    background: rgba(239, 68, 68, 0.08);
}
.file-preview-item.file-error {
    border-color: var(--rp-danger);
    background: rgba(239, 68, 68, 0.04);
}
.file-preview-item.file-error .file-name {
    color: var(--rp-danger);
}
.file-upload-total {
    margin-top: 6px;
    font-size: 0.75rem;
    color: var(--rp-gray-500);
}
.file-upload-total.over-limit {
    color: var(--rp-danger);
    font-weight: 600;
}

/* Dark mode upload zone */
.dark-mode .file-upload-zone {
    border-color: #374151;
    background: #141821;
}
.dark-mode .file-upload-zone:hover,
.dark-mode .file-upload-zone.dragover {
    border-color: var(--rp-orange);
    background: rgba(255, 122, 0, 0.06);
}
.dark-mode .file-upload-zone .upload-text {
    color: #d1d5db;
}
.dark-mode .file-upload-zone .upload-hint {
    color: #6b7280;
}
.dark-mode .file-preview-item {
    border-color: #374151;
    background-color: #141821;
}
.dark-mode .file-preview-item .file-icon {
    background: #1f2937;
    color: #9ca3af;
}
.dark-mode .file-preview-item .file-name {
    color: #e5e7eb;
}
.dark-mode .file-preview-item .file-size {
    color: #6b7280;
}
.dark-mode .file-preview-item .file-remove:hover {
    background: rgba(239, 68, 68, 0.12);
}
.dark-mode .file-preview-item.file-error {
    border-color: #b91c1c;
    background: rgba(239, 68, 68, 0.08);
}

/* Dark mode overrides for global search */
.dark-mode .global-search-container { background: #1a1f2e; border-color: #2d3548; }
.dark-mode .global-search-input { border-bottom-color: #2d3548; color: #e5e7eb; background-color: #1a1f2e; }
.dark-mode .search-result-item { color: #d1d5db; }
.dark-mode .search-result-item:hover { background: #2d3548; }

/* Dark mode overrides for Quill editor */
.dark-mode .ql-toolbar { background: #141821; border-color: #374151 !important; }
.dark-mode .ql-container { background: #141821; border-color: #374151 !important; color: #e5e7eb; }
.dark-mode .ql-editor { color: #e5e7eb; }
.dark-mode .ql-editor.ql-blank::before { color: #6b7280; }
.dark-mode .ql-picker-label { color: #d1d5db !important; }
.dark-mode .ql-picker-options { background: #1a1f2e !important; border-color: #374151 !important; }
.dark-mode .ql-picker-item { color: #d1d5db !important; }
.dark-mode .ql-picker-item:hover { color: var(--rp-orange) !important; }
.dark-mode .ql-stroke { stroke: #9ca3af !important; }
.dark-mode .ql-fill { fill: #9ca3af !important; }
.dark-mode .ql-toolbar button:hover .ql-stroke { stroke: var(--rp-orange) !important; }
.dark-mode .ql-toolbar button:hover .ql-fill { fill: var(--rp-orange) !important; }
.dark-mode .ql-toolbar button.ql-active .ql-stroke { stroke: var(--rp-orange) !important; }
.dark-mode .ql-toolbar button.ql-active .ql-fill { fill: var(--rp-orange) !important; }

/* ============================================================
   Page Content Entrance Animation
   ============================================================ */
.rp-content {
    animation: slideUp 0.3s ease;
}

/* =====================================================================
   Internal Tickets / Development Tracking
   ===================================================================== */

/* Dev-specific badge colors */
.badge-dev-primary {
    background: #2563eb;
    color: #fff;
}

.badge-dev-testing {
    background: #ea580c;
    color: #fff;
}

.badge-dev-deployed {
    background: #059669;
    color: #fff;
}

/* Dev Workflow Status Bar */
.dev-workflow-bar {
    display: flex;
    align-items: center;
    gap: 0;
    padding: 16px 0;
    overflow-x: auto;
}

.dev-workflow-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    min-width: 90px;
    position: relative;
    z-index: 1;
}

.dev-workflow-step .step-dot {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 3px solid var(--rp-gray-300);
    background: var(--rp-white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    transition: all 0.2s;
    position: relative;
    z-index: 2;
}

.dev-workflow-step.completed .step-dot {
    background: var(--rp-success);
    border-color: var(--rp-success);
    color: #fff;
}

.dev-workflow-step.current .step-dot {
    background: var(--rp-primary);
    border-color: var(--rp-primary);
    color: #fff;
    box-shadow: 0 0 0 4px rgba(30, 58, 95, 0.15);
    transform: scale(1.15);
}

.dev-workflow-step.future .step-dot {
    background: var(--rp-gray-100);
    border-color: var(--rp-gray-300);
    color: var(--rp-gray-400);
}

.dev-workflow-step .step-label {
    margin-top: 6px;
    font-size: 11px;
    text-align: center;
    color: var(--rp-gray-500);
    line-height: 1.2;
    max-width: 90px;
}

.dev-workflow-step.completed .step-label {
    color: var(--rp-success);
    font-weight: 500;
}

.dev-workflow-step.current .step-label {
    color: var(--rp-primary);
    font-weight: 700;
}

/* Connector lines between steps */
.dev-workflow-connector {
    flex: 0.5;
    height: 3px;
    background: var(--rp-gray-200);
    min-width: 20px;
    position: relative;
    top: -10px;
}

.dev-workflow-connector.completed {
    background: var(--rp-success);
}

/* Ticket Link Cards */
.ticket-link-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    border: 1px solid var(--rp-gray-200);
    border-radius: var(--rp-radius);
    margin-bottom: 8px;
    transition: background 0.15s;
}

.ticket-link-card:hover {
    background: var(--rp-gray-50);
}

.ticket-link-card .link-info {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
}

.ticket-link-card .link-type-label {
    font-size: 11px;
    color: var(--rp-gray-500);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.ticket-link-card .link-ticket-num {
    font-weight: 600;
    color: var(--rp-primary);
    white-space: nowrap;
}

.ticket-link-card .link-subject {
    color: var(--rp-gray-700);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ticket-link-card .link-actions {
    flex-shrink: 0;
    margin-left: 8px;
}

/* Dark mode overrides for internal tickets */
.dark-mode .dev-workflow-step .step-dot {
    background: var(--rp-gray-800);
    border-color: var(--rp-gray-600);
}

.dark-mode .dev-workflow-step.completed .step-dot {
    background: var(--rp-success);
    border-color: var(--rp-success);
}

.dark-mode .dev-workflow-step.current .step-dot {
    background: var(--rp-primary);
    border-color: var(--rp-primary);
    box-shadow: 0 0 0 4px rgba(30, 58, 95, 0.3);
}

.dark-mode .dev-workflow-step.future .step-dot {
    background: var(--rp-gray-700);
    border-color: var(--rp-gray-600);
    color: var(--rp-gray-500);
}

.dark-mode .dev-workflow-connector {
    background: var(--rp-gray-700);
}

.dark-mode .dev-workflow-connector.completed {
    background: var(--rp-success);
}

.dark-mode .ticket-link-card {
    border-color: var(--rp-gray-700);
}

.dark-mode .ticket-link-card:hover {
    background: var(--rp-gray-800);
}

.dark-mode .ticket-link-card .link-subject {
    color: var(--rp-gray-300);
}

/* Skeleton row for table loading */
.skeleton-row {
    display: flex;
    gap: 16px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--rp-gray-100);
    align-items: center;
}

.skeleton-cell {
    height: 14px;
    border-radius: var(--rp-radius-sm);
    background: linear-gradient(90deg, var(--rp-gray-100) 25%, var(--rp-gray-200) 50%, var(--rp-gray-100) 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s infinite;
}

.skeleton-cell-sm { width: 60px; flex-shrink: 0; }
.skeleton-cell-md { width: 120px; flex-shrink: 0; }
.skeleton-cell-lg { flex: 1; }

/* ============================================================
   Density System - Compact / Standard / Comfortable
   ============================================================ */

/* Compact density */
[data-density="compact"] {
    --rp-density-spacing: 12px;
    --rp-density-cell-v: 6px;
    --rp-density-cell-h: 10px;
    --rp-density-card-padding: 12px;
    --rp-density-gap: 12px;
}

[data-density="compact"] .card-header {
    padding: 10px 12px;
}

[data-density="compact"] .card-footer {
    padding: 8px 12px;
}

[data-density="compact"] .stat-value {
    font-size: 1.375rem;
}

[data-density="compact"] .stat-label {
    font-size: 0.75rem;
}

[data-density="compact"] .rp-table {
    font-size: 0.8125rem;
}

[data-density="compact"] .page-header {
    margin-bottom: 16px;
}

[data-density="compact"] .filter-bar {
    padding: 10px 12px;
    gap: 8px;
    margin-bottom: 12px;
}

[data-density="compact"] .form-group {
    margin-bottom: 10px;
}

[data-density="compact"] .form-control {
    padding: 5px 10px;
    font-size: 0.8125rem;
}

[data-density="compact"] .btn {
    padding: 5px 12px;
    font-size: 0.8125rem;
}

[data-density="compact"] .btn-sm {
    padding: 2px 8px;
    font-size: 0.6875rem;
}

[data-density="compact"] .badge {
    padding: 2px 7px;
    font-size: 0.625rem;
}

[data-density="compact"] .timeline-body {
    padding: 8px 12px;
    font-size: 0.8125rem;
}

[data-density="compact"] .rp-nav-item {
    padding: 7px 20px;
}

/* Comfortable density */
[data-density="comfortable"] {
    --rp-density-spacing: 28px;
    --rp-density-cell-v: 16px;
    --rp-density-cell-h: 20px;
    --rp-density-card-padding: 28px;
    --rp-density-gap: 24px;
}

[data-density="comfortable"] .card-header {
    padding: 20px 24px;
}

[data-density="comfortable"] .card-footer {
    padding: 16px 24px;
}

[data-density="comfortable"] .stat-value {
    font-size: 2rem;
}

[data-density="comfortable"] .rp-table {
    font-size: 0.9375rem;
}

[data-density="comfortable"] .page-header {
    margin-bottom: 32px;
}

[data-density="comfortable"] .filter-bar {
    padding: 20px 24px;
    gap: 16px;
    margin-bottom: 24px;
}

[data-density="comfortable"] .form-group {
    margin-bottom: 20px;
}

[data-density="comfortable"] .form-control {
    padding: 10px 14px;
    font-size: 0.9375rem;
}

[data-density="comfortable"] .btn {
    padding: 10px 20px;
    font-size: 0.9375rem;
}

[data-density="comfortable"] .timeline-body {
    padding: 16px 20px;
    font-size: 0.9375rem;
    line-height: 1.8;
}

[data-density="comfortable"] .rp-nav-item {
    padding: 12px 20px;
}

/* Density toggle button */
.density-toggle {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    background: var(--rp-gray-100);
    border-radius: 20px;
    padding: 3px;
    border: none;
    cursor: pointer;
}

.density-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 24px;
    border: none;
    border-radius: 16px;
    background: transparent;
    cursor: pointer;
    transition: var(--rp-transition-fast);
    color: var(--rp-gray-400);
    padding: 0;
}

.density-btn:hover {
    color: var(--rp-gray-700);
}

.density-btn.active {
    background: var(--rp-white);
    color: var(--rp-gray-900);
    box-shadow: var(--rp-shadow);
}

.dark-mode .density-toggle {
    background: #2d3548;
}

.dark-mode .density-btn.active {
    background: #1a1f2e;
    color: #f3f4f6;
}

/* ============================================================
   Enhanced Micro-Interactions
   ============================================================ */

/* Smooth card hover with subtle shadow progression */
.card {
    transition: var(--rp-transition-slow);
}

.card:hover {
    box-shadow: var(--rp-shadow-md);
}

/* Stat card enhanced hover */
.stat-card:hover {
    box-shadow: var(--rp-shadow-md);
    transform: translateY(-2px);
}

/* KB card smoother animation */
.kb-card {
    transition: var(--rp-transition-slow);
}

.kb-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--rp-shadow-lg);
}

/* Better dropdown animation */
.user-dropdown {
    transition: opacity 0.2s ease, transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.2s;
}

/* Smoother modal transition */
.modal {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-overlay {
    transition: opacity 0.3s ease, visibility 0.3s;
}

/* Page link hover lift */
.page-link {
    transition: var(--rp-transition-fast);
}

/* Tab underline slide */
.tab-btn {
    transition: color 0.2s ease, border-color 0.2s ease;
}

/* Toast enhanced animations */
@keyframes toast-in {
    from {
        opacity: 0;
        transform: translateX(40px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

@keyframes toast-out {
    from {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
    to {
        opacity: 0;
        transform: translateX(40px) scale(0.95);
    }
}

.toast {
    animation: toast-in 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 12px 16px;
    border-radius: var(--rp-radius);
    font-size: 0.875rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: var(--rp-shadow-lg);
    min-width: 280px;
    max-width: 420px;
}

.toast-success {
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    color: #065f46;
}

.toast-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
}

.toast-info {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #1e40af;
}

.toast-warning {
    background: #fffbeb;
    border: 1px solid #fde68a;
    color: #92400e;
}

.toast-close {
    background: none;
    border: none;
    cursor: pointer;
    opacity: 0.5;
    transition: opacity 0.15s;
    font-size: 1.125rem;
    line-height: 1;
    color: inherit;
    margin-left: auto;
    padding: 2px;
}

.toast-close:hover {
    opacity: 1;
}

.dark-mode .toast-success { background: rgba(16, 185, 129, 0.15); border-color: rgba(16, 185, 129, 0.3); color: #6ee7b7; }
.dark-mode .toast-error { background: rgba(239, 68, 68, 0.15); border-color: rgba(239, 68, 68, 0.3); color: #fca5a5; }
.dark-mode .toast-info { background: rgba(59, 130, 246, 0.15); border-color: rgba(59, 130, 246, 0.3); color: #93bbfd; }
.dark-mode .toast-warning { background: rgba(245, 158, 11, 0.15); border-color: rgba(245, 158, 11, 0.3); color: #fcd34d; }

/* ============================================================
   Dark Mode - Additional Polish
   ============================================================ */

/* Loading overlay */
.dark-mode .loading-overlay {
    background: rgba(15, 18, 25, 0.8);
}

/* Spinner */
.dark-mode .spinner {
    border-color: #374151;
    border-top-color: var(--rp-orange);
}

/* Article content in dark mode */
.dark-mode .article-content code {
    background: #2d3548;
    color: #e5e7eb;
}

.dark-mode .article-content blockquote {
    background: #141821;
    color: #9ca3af;
}

.dark-mode .article-content table th {
    background: #1f2937;
}

.dark-mode .article-content table th,
.dark-mode .article-content table td {
    border-color: #374151;
}

/* Workload bar track */
.dark-mode .workload-bar-track {
    background: #374151;
}

/* Selection color */
.dark-mode ::selection {
    background: rgba(255, 122, 0, 0.3);
    color: #f9fafb;
}

/* Stat icon backgrounds in dark mode */
.dark-mode .stat-card .stat-icon.orange { background: rgba(255, 122, 0, 0.15); }
.dark-mode .stat-card .stat-icon.blue { background: rgba(59, 130, 246, 0.15); }
.dark-mode .stat-card .stat-icon.green { background: rgba(16, 185, 129, 0.15); }
.dark-mode .stat-card .stat-icon.red { background: rgba(239, 68, 68, 0.15); }

/* Subscription card dark mode polish */
.dark-mode .subscription-card .subscription-header { border-bottom-color: #2d3548; }
.dark-mode .subscription-card .subscription-footer { border-top-color: #2d3548; background: #141821; }
.dark-mode .subscription-card .subscription-detail { border-bottom-color: #2d3548; }

/* Notification bell dark mode */
.dark-mode .btn-notif { color: var(--rp-gray-300); }
.dark-mode .btn-notif:hover { background: rgba(255,255,255,0.1); color: #fff; }

/* Filter tag dark mode */
.dark-mode .filter-tag { background: #2d3548; color: #d1d5db; }

/* KB search dark mode */
.dark-mode .kb-search .form-control {
    background-color: #141821;
    border-color: #374151;
}

/* Escalation badge dark mode */
.dark-mode .badge-escalated { background: rgba(147, 51, 234, 0.3); color: #c084fc; }

/* Global selection */
::selection {
    background: rgba(255, 122, 0, 0.15);
    color: inherit;
}

/* ============================================================
   Enhanced Responsive - Density adapts on mobile
   ============================================================ */
@media (max-width: 768px) {
    :root,
    [data-density="compact"],
    [data-density="comfortable"] {
        --rp-density-spacing: 16px;
        --rp-density-cell-v: 8px;
        --rp-density-cell-h: 10px;
        --rp-density-card-padding: 16px;
        --rp-density-gap: 16px;
    }

    .density-toggle {
        display: none;
    }
}

@media (max-width: 480px) {
    :root,
    [data-density="compact"],
    [data-density="comfortable"] {
        --rp-density-spacing: 12px;
        --rp-density-cell-v: 6px;
        --rp-density-cell-h: 8px;
        --rp-density-card-padding: 12px;
        --rp-density-gap: 12px;
    }
}

/* =============================================================================
   EXPORT BUILDER
   ============================================================================= */
.export-tabs {
    display: flex;
    border-bottom: 2px solid var(--rp-gray-200);
    padding: 0 20px;
    background-color: var(--rp-gray-50);
}
.export-tab {
    padding: 10px 20px;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 14px;
    color: var(--rp-gray-600);
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: color 0.15s, border-color 0.15s;
}
.export-tab:hover { color: var(--rp-gray-900); }
.export-tab.active {
    color: var(--rp-orange);
    border-bottom-color: var(--rp-orange);
    font-weight: 600;
}
.export-tab-content {
    display: none;
    padding: 20px;
}
.export-tab-content.active { display: block; }

.export-col-list {
    max-height: 340px;
    overflow-y: auto;
    border: 1px solid var(--rp-gray-200);
    border-radius: var(--rp-radius);
}
.export-col-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-bottom: 1px solid var(--rp-gray-100);
}
.export-col-item:last-child { border-bottom: none; }
.export-col-check { flex-shrink: 0; margin: 0; cursor: pointer; }
.export-col-key {
    flex-shrink: 0;
    width: 120px;
    font-family: monospace;
    font-size: 12px;
    color: var(--rp-gray-500);
}
.export-col-header {
    flex: 1;
    padding: 4px 8px;
    font-size: 13px;
}
.export-col-arrows {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex-shrink: 0;
}
.btn-arrow {
    width: 24px;
    height: 18px;
    padding: 0;
    border: 1px solid var(--rp-gray-300);
    background-color: var(--rp-gray-50);
    border-radius: 3px;
    cursor: pointer;
    font-size: 11px;
    line-height: 1;
    color: var(--rp-gray-600);
    display: flex;
    align-items: center;
    justify-content: center;
}
.btn-arrow:hover:not(:disabled) {
    background-color: var(--rp-gray-200);
}
.btn-arrow:disabled {
    opacity: 0.3;
    cursor: default;
}

/* Dark mode - export builder */
.dark-mode .export-tabs { background-color: #0d1117; border-bottom-color: #2d3548; }
.dark-mode .export-tab { color: #9ca3af; }
.dark-mode .export-tab:hover { color: #e5e7eb; }
.dark-mode .export-tab.active { color: var(--rp-orange); }
.dark-mode .export-col-list { border-color: #2d3548; }
.dark-mode .export-col-item { border-bottom-color: #1e2633; }
.dark-mode .export-col-key { color: #6b7280; }
.dark-mode .btn-arrow { border-color: #374151; background-color: #1e2633; color: #9ca3af; }
.dark-mode .btn-arrow:hover:not(:disabled) { background-color: #2d3548; }

/* ============================================================
   User Guide / Help Center
   ============================================================ */

/* --- Hero Banner --- */
.guide-hero {
    background: linear-gradient(135deg, #0b1726 0%, #1a2c42 50%, #1e3a5f 100%);
    border-radius: var(--rp-radius-xl);
    padding: 44px 40px;
    margin-bottom: 32px;
    position: relative;
    overflow: hidden;
}
.guide-hero::before {
    content: '';
    position: absolute;
    top: -60%;
    right: -15%;
    width: 420px;
    height: 420px;
    background: radial-gradient(circle, rgba(255, 122, 0, 0.12) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}
.guide-hero::after {
    content: '';
    position: absolute;
    bottom: -40%;
    left: -8%;
    width: 320px;
    height: 320px;
    background: radial-gradient(circle, rgba(30, 58, 95, 0.25) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}
.guide-hero-content {
    position: relative;
    z-index: 1;
}
.guide-hero-icon {
    width: 52px;
    height: 52px;
    background: rgba(255, 122, 0, 0.15);
    border: 1px solid rgba(255, 122, 0, 0.25);
    border-radius: var(--rp-radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 18px;
    color: var(--rp-orange);
}
.guide-hero-title {
    font-size: 26px;
    font-weight: 700;
    color: #ffffff;
    margin: 0 0 8px 0;
    letter-spacing: -0.3px;
}
.guide-hero-subtitle {
    font-size: 15px;
    color: rgba(255, 255, 255, 0.65);
    margin: 0;
    max-width: 560px;
    line-height: 1.6;
}

/* --- Table of Contents Grid --- */
.guide-toc {
    margin-bottom: 32px;
    background: none;
    border: none;
    padding: 0;
}
.guide-toc-header {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--rp-gray-400);
    margin: 0 0 14px 0;
}
.guide-toc-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 10px;
    list-style: none;
    padding: 0;
    margin: 0;
}
.guide-toc-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--rp-white);
    border: 1px solid var(--rp-gray-200);
    border-radius: var(--rp-radius);
    text-decoration: none;
    color: var(--rp-gray-800);
    transition: var(--rp-transition);
    cursor: pointer;
}
.guide-toc-item:hover {
    border-color: var(--rp-orange);
    box-shadow: var(--rp-shadow);
    transform: translateY(-1px);
    text-decoration: none;
    color: var(--rp-gray-800);
}
.guide-toc-num {
    width: 30px;
    height: 30px;
    background: rgba(255, 122, 0, 0.08);
    color: var(--rp-orange);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    flex-shrink: 0;
    transition: var(--rp-transition-fast);
}
.guide-toc-item:hover .guide-toc-num {
    background: var(--rp-orange);
    color: #fff;
}
.guide-toc-label {
    font-size: 13px;
    font-weight: 600;
    line-height: 1.3;
}

/* --- Collapsible Sections --- */
.guide-section {
    margin-bottom: 8px;
    border: 1px solid var(--rp-gray-200);
    border-radius: var(--rp-radius-lg);
    background: var(--rp-white);
    overflow: hidden;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.guide-section:hover {
    border-color: var(--rp-gray-300);
}
.guide-section.active {
    border-color: var(--rp-orange);
    box-shadow: 0 0 0 3px rgba(255, 122, 0, 0.08);
}
.guide-section-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 20px;
    cursor: pointer;
    user-select: none;
    transition: background-color 0.15s ease;
}
.guide-section-header:hover {
    background-color: var(--rp-gray-50);
}
.guide-section-badge {
    width: 34px;
    height: 34px;
    background: linear-gradient(135deg, var(--rp-orange), var(--rp-orange-light));
    color: #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    flex-shrink: 0;
    transition: box-shadow 0.2s ease;
}
.guide-section.active .guide-section-badge {
    box-shadow: 0 0 0 4px rgba(255, 122, 0, 0.12);
}
.guide-section-title {
    flex: 1;
    font-size: 15px;
    font-weight: 600;
    margin: 0;
    color: var(--rp-gray-900);
}
.guide-chevron {
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
    color: var(--rp-gray-400);
}
.guide-section.active .guide-chevron {
    transform: rotate(180deg);
    color: var(--rp-orange);
}
.guide-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.guide-section.active .guide-body {
    max-height: 12000px;
}
.guide-body-inner {
    padding: 4px 24px 28px 68px;
    border-top: 1px solid var(--rp-gray-100);
}

/* --- Typography inside guide body --- */
.guide-body-inner h4 {
    margin: 24px 0 8px 0;
    font-size: 14px;
    font-weight: 700;
    color: var(--rp-orange);
    letter-spacing: 0.2px;
}
.guide-body-inner h4:first-child {
    margin-top: 16px;
}
.guide-body-inner p {
    margin: 0 0 12px 0;
    line-height: 1.7;
    font-size: 13.5px;
    color: var(--rp-gray-600);
}
.guide-body-inner > p:first-child {
    margin-top: 16px;
    font-size: 14px;
    color: var(--rp-gray-700);
}
.guide-body-inner ul,
.guide-body-inner ol {
    margin: 8px 0 16px 0;
    padding-left: 20px;
    color: var(--rp-gray-600);
    font-size: 13.5px;
    line-height: 1.7;
}
.guide-body-inner li {
    margin-bottom: 4px;
}
.guide-body-inner strong {
    color: var(--rp-gray-800);
    font-weight: 600;
}

/* --- Callout Boxes --- */
.guide-callout {
    display: flex;
    gap: 12px;
    padding: 14px 16px;
    border-radius: var(--rp-radius);
    margin: 16px 0;
    font-size: 13px;
    line-height: 1.6;
    border: 1px solid;
}
.guide-callout-icon {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    margin-top: 1px;
}
.guide-callout-content {
    flex: 1;
    min-width: 0;
}
.guide-callout-content strong {
    display: block;
    margin-bottom: 2px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.guide-callout-tip {
    background-color: rgba(16, 185, 129, 0.06);
    border-color: rgba(16, 185, 129, 0.2);
    color: var(--rp-gray-700);
}
.guide-callout-tip .guide-callout-icon { color: var(--rp-success); }
.guide-callout-tip strong { color: var(--rp-success); }
.guide-callout-note {
    background-color: rgba(59, 130, 246, 0.06);
    border-color: rgba(59, 130, 246, 0.2);
    color: var(--rp-gray-700);
}
.guide-callout-note .guide-callout-icon { color: var(--rp-info); }
.guide-callout-note strong { color: var(--rp-info); }
.guide-callout-warning {
    background-color: rgba(245, 158, 11, 0.06);
    border-color: rgba(245, 158, 11, 0.2);
    color: var(--rp-gray-700);
}
.guide-callout-warning .guide-callout-icon { color: var(--rp-warning); }
.guide-callout-warning strong { color: var(--rp-warning); }

/* --- Step Lists --- */
.guide-steps {
    list-style: none;
    padding: 0;
    margin: 12px 0 16px 0;
    counter-reset: guide-step;
}
.guide-step {
    counter-increment: guide-step;
    display: flex;
    gap: 12px;
    padding: 10px 0;
    font-size: 13.5px;
    line-height: 1.6;
    color: var(--rp-gray-600);
}
.guide-step::before {
    content: counter(guide-step);
    width: 26px;
    height: 26px;
    background: rgba(255, 122, 0, 0.08);
    color: var(--rp-orange);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    flex-shrink: 0;
    margin-top: 1px;
}

/* --- Status Workflow Diagram --- */
.guide-workflow {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin: 14px 0 18px 0;
    padding: 16px;
    background: var(--rp-gray-50);
    border-radius: var(--rp-radius);
    border: 1px solid var(--rp-gray-200);
}
.guide-workflow-step {
    display: inline-flex;
    align-items: center;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    background: var(--rp-white);
    border: 1px solid var(--rp-gray-300);
    color: var(--rp-gray-700);
}
.guide-workflow-arrow {
    color: var(--rp-gray-400);
    font-size: 14px;
    flex-shrink: 0;
}
.guide-workflow-step.wf-new { border-color: rgba(59, 130, 246, 0.4); color: var(--rp-info); background: rgba(59, 130, 246, 0.06); }
.guide-workflow-step.wf-active { border-color: rgba(255, 122, 0, 0.4); color: var(--rp-orange); background: rgba(255, 122, 0, 0.06); }
.guide-workflow-step.wf-wait { border-color: rgba(245, 158, 11, 0.4); color: #b45309; background: rgba(245, 158, 11, 0.06); }
.guide-workflow-step.wf-done { border-color: rgba(16, 185, 129, 0.4); color: #047857; background: rgba(16, 185, 129, 0.06); }

/* --- Keyboard Shortcuts --- */
.guide-kbd {
    display: inline-block;
    padding: 2px 7px;
    font-size: 11px;
    font-family: var(--rp-font-mono);
    font-weight: 600;
    color: var(--rp-gray-700);
    background: var(--rp-gray-100);
    border: 1px solid var(--rp-gray-300);
    border-radius: 4px;
    box-shadow: 0 1px 0 var(--rp-gray-300);
    vertical-align: baseline;
    line-height: 1.4;
}

/* --- Feature Check List --- */
.guide-features {
    list-style: none;
    padding: 0;
    margin: 8px 0 16px 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 6px;
}
.guide-features li {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 13px;
    color: var(--rp-gray-600);
    padding: 4px 0;
    line-height: 1.5;
}
.guide-features li::before {
    content: '';
    width: 18px;
    height: 18px;
    background: rgba(16, 185, 129, 0.1);
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 1px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%2310b981' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 10px;
}

/* --- Reference Tables --- */
.guide-ref-table {
    width: 100%;
    border-collapse: collapse;
    margin: 12px 0 18px 0;
    font-size: 13px;
    border-radius: var(--rp-radius);
    overflow: hidden;
    border: 1px solid var(--rp-gray-200);
}
.guide-ref-table th {
    background: var(--rp-gray-50);
    font-weight: 600;
    text-align: left;
    padding: 10px 14px;
    color: var(--rp-gray-700);
    border-bottom: 2px solid var(--rp-gray-200);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.guide-ref-table td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--rp-gray-100);
    color: var(--rp-gray-600);
    line-height: 1.5;
    vertical-align: top;
}
.guide-ref-table tr:last-child td { border-bottom: none; }
.guide-ref-table td:first-child {
    font-weight: 600;
    color: var(--rp-gray-800);
    white-space: nowrap;
}

/* --- Dark Mode: Guide Overrides --- */
.dark-mode .guide-toc-item {
    background-color: #1a1f2e;
    border-color: #2d3548;
    color: #e5e7eb;
}
.dark-mode .guide-toc-item:hover {
    border-color: var(--rp-orange);
    color: #e5e7eb;
}
.dark-mode .guide-toc-num {
    background: rgba(255, 122, 0, 0.12);
}
.dark-mode .guide-section {
    background-color: #1a1f2e;
    border-color: #2d3548;
}
.dark-mode .guide-section:hover {
    border-color: #374151;
}
.dark-mode .guide-section.active {
    border-color: var(--rp-orange);
    box-shadow: 0 0 0 3px rgba(255, 122, 0, 0.06);
}
.dark-mode .guide-section-header:hover {
    background-color: rgba(255, 255, 255, 0.04);
}
.dark-mode .guide-section-title {
    color: #e5e7eb;
}
.dark-mode .guide-body-inner {
    border-top-color: #2d3548;
}
.dark-mode .guide-body-inner p {
    color: #9ca3af;
}
.dark-mode .guide-body-inner > p:first-child {
    color: #d1d5db;
}
.dark-mode .guide-body-inner strong {
    color: #e5e7eb;
}
.dark-mode .guide-body-inner ul,
.dark-mode .guide-body-inner ol {
    color: #9ca3af;
}
.dark-mode .guide-callout-tip {
    background-color: rgba(16, 185, 129, 0.08);
    border-color: rgba(16, 185, 129, 0.18);
    color: #d1d5db;
}
.dark-mode .guide-callout-note {
    background-color: rgba(59, 130, 246, 0.08);
    border-color: rgba(59, 130, 246, 0.18);
    color: #d1d5db;
}
.dark-mode .guide-callout-warning {
    background-color: rgba(245, 158, 11, 0.08);
    border-color: rgba(245, 158, 11, 0.18);
    color: #d1d5db;
}
.dark-mode .guide-step {
    color: #9ca3af;
}
.dark-mode .guide-step::before {
    background: rgba(255, 122, 0, 0.12);
}
.dark-mode .guide-workflow {
    background-color: #141821;
    border-color: #2d3548;
}
.dark-mode .guide-workflow-step {
    background-color: #1a1f2e;
    border-color: #374151;
    color: #d1d5db;
}
.dark-mode .guide-workflow-arrow {
    color: #4b5563;
}
.dark-mode .guide-workflow-step.wf-new { background: rgba(59, 130, 246, 0.1); border-color: rgba(59, 130, 246, 0.25); color: #93bbfd; }
.dark-mode .guide-workflow-step.wf-active { background: rgba(255, 122, 0, 0.1); border-color: rgba(255, 122, 0, 0.25); color: var(--rp-orange-light); }
.dark-mode .guide-workflow-step.wf-wait { background: rgba(245, 158, 11, 0.1); border-color: rgba(245, 158, 11, 0.25); color: #fcd34d; }
.dark-mode .guide-workflow-step.wf-done { background: rgba(16, 185, 129, 0.1); border-color: rgba(16, 185, 129, 0.25); color: #6ee7b7; }
.dark-mode .guide-kbd {
    background-color: #2d3548;
    border-color: #4b5563;
    box-shadow: 0 1px 0 #374151;
    color: #d1d5db;
}
.dark-mode .guide-features li {
    color: #9ca3af;
}
.dark-mode .guide-ref-table {
    border-color: #2d3548;
}
.dark-mode .guide-ref-table th {
    background-color: #141821;
    color: #d1d5db;
    border-bottom-color: #2d3548;
}
.dark-mode .guide-ref-table td {
    border-bottom-color: #2d3548;
    color: #9ca3af;
}
.dark-mode .guide-ref-table td:first-child {
    color: #e5e7eb;
}

/* --- Mobile Responsive: Guides --- */
@media (max-width: 768px) {
    .guide-hero {
        padding: 28px 20px;
        border-radius: var(--rp-radius);
    }
    .guide-hero-title { font-size: 22px; }
    .guide-hero-subtitle { font-size: 14px; }
    .guide-toc-grid {
        grid-template-columns: 1fr;
    }
    .guide-section-header {
        padding: 14px 16px;
        gap: 10px;
    }
    .guide-body-inner {
        padding: 4px 16px 20px 16px;
    }
    .guide-section-badge {
        width: 28px;
        height: 28px;
        font-size: 11px;
    }
    .guide-workflow {
        gap: 4px;
        padding: 12px;
    }
    .guide-features {
        grid-template-columns: 1fr;
    }
    .guide-ref-table {
        font-size: 12px;
    }
    .guide-ref-table th,
    .guide-ref-table td {
        padding: 8px 10px;
    }
}

/* ------------------------------------------------------------
   Shareable Ticket Link - Copy Button
   ------------------------------------------------------------ */
.btn-copy-link {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--rp-gray-400);
    padding: 2px 4px;
    margin-left: 4px;
    border-radius: var(--rp-radius);
    vertical-align: middle;
    transition: color 0.15s, background-color 0.15s;
}
.btn-copy-link:hover {
    color: var(--rp-orange);
    background-color: var(--rp-gray-100);
}
.btn-copy-link svg {
    width: 14px;
    height: 14px;
    vertical-align: middle;
}
.dark-mode .btn-copy-link {
    color: var(--rp-gray-400);
}
.dark-mode .btn-copy-link:hover {
    color: var(--rp-orange);
    background-color: rgba(255, 255, 255, 0.08);
}
