/* =========================================================
   RMS — Main Stylesheet
   Design: Clean, professional, no glassmorphism.
   Font: Inter (system-quality readability)
   ========================================================= */

/* --- Tokens -------------------------------------------- */
:root {
    --accent:       #2563eb;
    --accent-dark:  #1d4ed8;
    --success:      #16a34a;
    --danger:       #dc2626;
    --warning:      #d97706;

    --bg-main:      #f5f7fa;
    --bg-sidebar:   #ffffff;
    --bg-card:      #ffffff;

    --text-main:    #0f172a;
    --text-muted:   #64748b;
    --text-faint:   #94a3b8;

    --border:       #e2e8f0;
    --border-focus: #2563eb;

    --radius-sm:    6px;
    --radius-md:    10px;
    --radius-lg:    14px;

    --shadow-sm:    0 1px 3px rgba(0,0,0,.07);
    --shadow-md:    0 4px 12px rgba(0,0,0,.08);

    --transition:   all 0.18s ease;
}

[data-theme="dark"] {
    --bg-main:      #0f172a;
    --bg-sidebar:   #1e293b;
    --bg-card:      #1e293b;
    --text-main:    #f1f5f9;
    --text-muted:   #94a3b8;
    --text-faint:   #64748b;
    --border:       #334155;
}

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

body {
    font-family: 'Inter', 'Outfit', system-ui, sans-serif;
    font-size: 13px;
    line-height: 1.5;
    background: var(--bg-main);
    color: var(--text-main);
    -webkit-font-smoothing: antialiased;
    transition: background-color 0.2s, color 0.2s;
}

/* =========================================================
   AUTH PAGES — Login & Register
   Premium animated design with gradient bg, glassmorphism,
   floating particles, and typewriter text.
   ========================================================= */

/* --- Animated gradient background --- */
.auth-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    height: 100vh; /* Force full height */
    width: 100vw;  /* Force full width */
    position: fixed;
    top: 0;
    left: 0;
    padding: 0;
    margin: 0;
    z-index: 9999; /* Ensure it's above everything */
    background: linear-gradient(-45deg, #0f172a, #1e3a5f, #1a1a2e, #16213e);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
    overflow: hidden;
}

.auth-page::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 20% 50%, rgba(37, 99, 235, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(139, 92, 246, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 50% 80%, rgba(6, 182, 212, 0.08) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

@keyframes gradientShift {
    0%   { background-position: 0% 50%; }
    50%  { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* --- Floating particles --- */
.auth-particles {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 0;
}

.auth-particles .particle {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
    animation: floatParticle linear infinite;
}

@keyframes floatParticle {
    0%   { transform: translateY(100vh) scale(0); opacity: 0; }
    10%  { opacity: 1; }
    90%  { opacity: 1; }
    100% { transform: translateY(-10vh) scale(1); opacity: 0; }
}

/* --- Glassmorphic card --- */
.auth-container {
    width: 90%;
    max-width: 400px;
    margin: auto; /* Fallback for flex centering */
    background: rgba(255, 255, 255, 0.07);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 20px;
    padding: 2.5rem 2rem;
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.3),
        0 0 80px rgba(37, 99, 235, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    position: relative;
    z-index: 1;
    animation: cardEntrance 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes cardEntrance {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Subtle glow ring around card */
.auth-container::before {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: 21px;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.3), rgba(139, 92, 246, 0.15), transparent, rgba(6, 182, 212, 0.2));
    z-index: -1;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.auth-container:hover::before {
    opacity: 1;
}

/* --- Brand block --- */
.auth-brand {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-logo {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, #2563eb, #7c3aed);
    border-radius: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.4rem;
    margin-bottom: 1rem;
    box-shadow: 0 4px 20px rgba(37, 99, 235, 0.4);
    animation: logoPulse 3s ease-in-out infinite;
    position: relative;
}

@keyframes logoPulse {
    0%, 100% { box-shadow: 0 4px 20px rgba(37, 99, 235, 0.4); }
    50%      { box-shadow: 0 4px 30px rgba(37, 99, 235, 0.6), 0 0 60px rgba(37, 99, 235, 0.15); }
}

.auth-brand h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.02em;
}

.auth-brand p {
    font-size: 0.82rem;
    color: rgba(255, 255, 255, 0.55);
    margin-top: 0.3rem;
}

/* --- Animated typewriter text --- */
.auth-typewriter {
    display: inline-block;
    overflow: hidden;
    white-space: nowrap;
    border-right: 2px solid rgba(37, 99, 235, 0.8);
    animation: typewriterBlink 0.75s step-end infinite;
    font-size: 0.82rem;
    color: rgba(255, 255, 255, 0.55);
    margin-top: 0.3rem;
    max-width: 100%;
}

@keyframes typewriterBlink {
    0%, 100% { border-color: rgba(37, 99, 235, 0.8); }
    50%      { border-color: transparent; }
}

/* --- Animated word rotator --- */
.auth-word-rotator {
    display: inline-block;
    position: relative;
    height: 1.2em;
    overflow: hidden;
    vertical-align: bottom;
}

.auth-word-rotator .word {
    display: block;
    position: absolute;
    width: 100%;
    animation: wordRotate 8s ease-in-out infinite;
    opacity: 0;
    color: #60a5fa;
    font-weight: 600;
}

.auth-word-rotator .word:nth-child(1) { animation-delay: 0s; }
.auth-word-rotator .word:nth-child(2) { animation-delay: 2s; }
.auth-word-rotator .word:nth-child(3) { animation-delay: 4s; }
.auth-word-rotator .word:nth-child(4) { animation-delay: 6s; }

@keyframes wordRotate {
    0%, 5%   { opacity: 0; transform: translateY(100%); }
    10%, 20% { opacity: 1; transform: translateY(0); }
    25%, 30% { opacity: 0; transform: translateY(-100%); }
    100%     { opacity: 0; }
}

/* --- Form (dark-adapted) --- */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.auth-field {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    animation: fieldSlideIn 0.5s ease both;
}

.auth-field:nth-child(1) { animation-delay: 0.15s; }
.auth-field:nth-child(2) { animation-delay: 0.25s; }
.auth-field:nth-child(3) { animation-delay: 0.35s; }
.auth-field:nth-child(4) { animation-delay: 0.45s; }

@keyframes fieldSlideIn {
    from { opacity: 0; transform: translateX(-12px); }
    to   { opacity: 1; transform: translateX(0); }
}

.auth-field label {
    font-size: 0.72rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    cursor: default;
    display: block;
}

.auth-field input,
.auth-container input[type="email"],
.auth-container input[type="password"],
.auth-container input[type="text"],
.auth-container input[type="number"] {
    width: 100%;
    padding: 0.65rem 0.9rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.05);
    color: #f1f5f9;
    font-size: 0.85rem;
    outline: none;
    transition: all 0.25s ease;
}

.auth-field input::placeholder,
.auth-container input::placeholder {
    color: rgba(255, 255, 255, 0.25);
}

.auth-field input:focus,
.auth-container input:focus {
    border-color: rgba(37, 99, 235, 0.6);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15), 0 0 20px rgba(37, 99, 235, 0.08);
    background: rgba(255, 255, 255, 0.08);
}

/* --- Submit button with shimmer --- */
.auth-btn {
    width: 100%;
    padding: 0.7rem 1rem;
    background: linear-gradient(135deg, #2563eb, #7c3aed);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    letter-spacing: 0.01em;
    position: relative;
    overflow: hidden;
}

.auth-btn::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
    animation: btnShimmer 3s ease-in-out infinite;
}

@keyframes btnShimmer {
    0%   { left: -100%; }
    50%  { left: 100%; }
    100% { left: 100%; }
}

.auth-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(37, 99, 235, 0.4);
}

.auth-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(37, 99, 235, 0.3);
}

/* --- Footer links --- */
.auth-footer {
    margin-top: 1.25rem;
    text-align: center;
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.4);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.auth-footer a {
    color: #60a5fa;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.auth-footer a:hover { color: #93c5fd; text-decoration: underline; }

.auth-portals {
    margin-top: 0.75rem;
    text-align: center;
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.25);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
}

.auth-portals a {
    color: rgba(255, 255, 255, 0.4);
    text-decoration: none;
    transition: color 0.2s;
}

.auth-portals a:hover { color: #60a5fa; }

/* --- Success Panel --- */
.success-panel {
    display: none;
    text-align: center;
    animation: fadeUp 0.35s ease-out;
}

.success-icon {
    width: 64px;
    height: 64px;
    background: rgba(22, 163, 74, 0.15);
    color: #4ade80;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    margin-bottom: 1rem;
    box-shadow: 0 0 30px rgba(22, 163, 74, 0.2);
}

.success-panel h3 {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: #fff;
}

.success-panel p {
    font-size: 0.82rem;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 1.5rem;
    line-height: 1.6;
}


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

/* =========================================================
   DASHBOARD LAYOUT
   ========================================================= */

.app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 220px;
    flex-shrink: 0;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border);
    padding: 1.5rem 0.75rem;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-main);
    padding: 0 0.5rem;
    margin-bottom: 1.75rem;
}

.logo i { color: var(--accent); font-size: 1.1rem; }

nav {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

nav a {
    text-decoration: none;
    color: var(--text-muted);
    padding: 0.55rem 0.75rem;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.82rem;
    font-weight: 500;
    transition: var(--transition);
    cursor: pointer;
}

nav a i { width: 16px; text-align: center; font-size: 0.85rem; }

nav a:hover { background: var(--bg-main); color: var(--text-main); }

nav a.active {
    background: #eff6ff;
    color: var(--accent);
    font-weight: 600;
}

[data-theme="dark"] nav a.active { background: #1e3a5f; }

.logout-btn {
    padding: 0.75rem 0 0;
    border-top: 1px solid var(--border);
    margin-top: 0.5rem;
}

/* Top Nav / Header */
.main-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.top-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1.5rem;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 10;
}

.top-nav h3 {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-main);
}

.content-body {
    padding: 1.5rem;
    flex-grow: 1;
    overflow-y: auto;
}

/* View Management */
.content-view { display: none !important; }
.content-view.active { display: block !important; }

/* Section headers */
.welcome-section { margin-bottom: 1.25rem; }
.welcome-section h2 { font-size: 1.1rem; font-weight: 700; margin-bottom: 0.2rem; }
.welcome-section p { font-size: 0.8rem; color: var(--text-muted); }

/* =========================================================
   STATS / CARDS
   ========================================================= */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.stat-card {
    background: var(--bg-card);
    padding: 1.1rem 1.25rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 0.85rem;
    transition: var(--transition);
}

.stat-card:hover {
    box-shadow: var(--shadow-sm);
    border-color: #cbd5e1;
}

.stat-icon {
    width: 40px;
    height: 40px;
    background: #eff6ff;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
    font-size: 1rem;
    flex-shrink: 0;
}

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

.stat-label {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    display: block;
    margin-bottom: 0.2rem;
}

.stat-info h3, .stat-info h4 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-main);
    line-height: 1;
}

.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    margin-bottom: 1rem;
}

.settings-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    margin-bottom: 0.75rem;
}

/* =========================================================
   TABLES
   ========================================================= */

.table-container { overflow-x: auto; }

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
}

.data-table th,
.data-table td {
    padding: 0.6rem 0.85rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.data-table th {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: var(--bg-main);
}

.data-table tr:hover td { background: var(--bg-main); }

/* =========================================================
   BUTTONS
   ========================================================= */

.btn-primary {
    background: var(--accent);
    border: none;
    color: #fff;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
    transition: var(--transition);
}

.btn-primary:hover { background: var(--accent-dark); }

.btn-secondary {
    background: var(--bg-main);
    border: 1px solid var(--border);
    color: var(--text-main);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 500;
    transition: var(--transition);
}

.btn-secondary:hover { border-color: var(--accent); color: var(--accent); }

.btn-danger {
    background: var(--danger);
    color: #fff;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.8rem;
}

.btn-danger:hover { background: #b91c1c; }

.btn-text {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.8rem;
    padding: 0.4rem 0.75rem;
    transition: var(--transition);
    width: 100%;
    text-align: left;
    border-radius: var(--radius-sm);
}

.btn-text:hover { color: var(--text-main); background: var(--bg-main); }

.btn-block { width: 100%; }

.icon-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1rem;
    padding: 0.4rem;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.icon-btn:hover { background: var(--bg-main); color: var(--text-main); }

/* =========================================================
   FORM ELEMENTS
   ========================================================= */

.form-group {
    margin-bottom: 0.85rem;
    position: relative;
}

.form-group label {
    display: block;
    margin-bottom: 0.35rem;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: default;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.55rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-main);
    color: var(--text-main);
    font-size: 0.82rem;
    outline: none;
    transition: border-color 0.15s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}

.form-group i {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-faint);
    font-size: 0.8rem;
    pointer-events: none;
}

textarea {
    width: 100%;
    padding: 0.6rem 0.85rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-main);
    color: var(--text-main);
    font-size: 0.82rem;
    outline: none;
    min-height: 90px;
    font-family: inherit;
    transition: border-color 0.15s;
    resize: vertical;
}

textarea:focus { border-color: var(--accent); }

input[type="checkbox"] {
    width: 14px;
    height: 14px;
    cursor: pointer;
    accent-color: var(--accent);
}

label { cursor: pointer; color: var(--text-main); display: flex; align-items: center; }

/* =========================================================
   STATUS BADGES
   ========================================================= */

.status-badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.status-paid   { background: #dcfce7; color: var(--success); }
.status-pending { background: #fef3c7; color: var(--warning); }
.status-overdue { background: #fee2e2; color: var(--danger); }

/* =========================================================
   NOTIFICATIONS
   ========================================================= */

.notifications-list { margin-top: 0.85rem; }

.notification-item {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.75rem 1rem;
    margin-bottom: 0.5rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    cursor: pointer;
    transition: var(--transition);
}

.notification-item:hover { background: var(--bg-main); }
.notification-item.unread { border-left: 3px solid var(--accent); }

.notification-content h4 { font-size: 0.82rem; margin-bottom: 0.15rem; }

.notification-content p { color: var(--text-muted); font-size: 0.76rem; }

.notification-time { font-size: 0.68rem; color: var(--text-faint); white-space: nowrap; }

/* =========================================================
   MODALS
   ========================================================= */

.modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
}

.modal-content {
    background: var(--bg-card);
    padding: 1.5rem;
    border-radius: var(--radius-md);
    max-width: 480px;
    width: 100%;
    position: relative;
    box-shadow: var(--shadow-md);
}

.modal-content h3 { font-size: 0.95rem; font-weight: 700; margin-bottom: 1rem; }

.close {
    position: absolute;
    top: 0.85rem;
    right: 1rem;
    font-size: 1.25rem;
    cursor: pointer;
    color: var(--text-muted);
    line-height: 1;
}

.close:hover { color: var(--danger); }

/* =========================================================
   PAYMENT
   ========================================================= */

.payment-actions {
    background: var(--bg-card);
    padding: 1.25rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
}

.payment-methods {
    display: flex;
    gap: 0.75rem;
    margin: 0.75rem 0;
    flex-wrap: wrap;
}

.method-btn {
    flex: 1;
    padding: 0.7rem;
    background: var(--bg-main);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 500;
    transition: var(--transition);
}

.method-btn:hover, .method-btn.selected {
    border-color: var(--accent);
    color: var(--accent);
}

.manual-mpesa {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    flex-wrap: wrap;
}

.manual-mpesa input {
    flex: 1;
    min-width: 180px;
    padding: 0.55rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-main);
    color: var(--text-main);
    font-size: 0.82rem;
    outline: none;
}

.manual-mpesa button {
    padding: 0.55rem 1rem;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
    transition: var(--transition);
}

.manual-mpesa button:hover { background: var(--accent-dark); }

/* =========================================================
   PROFILE
   ========================================================= */

.profile-section { display: flex; gap: 1.5rem; flex-wrap: wrap; }

.profile-avatar-container { position: relative; }

.profile-avatar-container img {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border);
}

.avatar-upload-btn {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--accent);
    border: none;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
}

.profile-info { flex: 1; }
.profile-info p { margin-bottom: 0.35rem; font-size: 0.82rem; }

/* =========================================================
   MISC
   ========================================================= */

.badge {
    background: var(--danger);
    color: #fff;
    border-radius: 20px;
    padding: 0.1rem 0.45rem;
    font-size: 0.65rem;
    font-weight: 700;
    margin-left: auto;
}

.header-actions { display: flex; gap: 0.5rem; align-items: center; }

#profile-avatar { transition: transform 0.2s; }
#profile-avatar:hover { transform: scale(1.05); }

body.no-select { user-select: none; }

/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (max-width: 768px) {
    .app-container { flex-direction: column; }

    .sidebar {
        width: 100%;
        height: auto;
        position: static;
        flex-direction: row;
        flex-wrap: wrap;
        padding: 0.75rem;
    }

    .sidebar nav { flex-direction: row; flex-wrap: wrap; }

    .content-body { padding: 1rem; }

    .stats-grid { grid-template-columns: 1fr 1fr; }

    .profile-section { flex-direction: column; align-items: center; text-align: center; }

    .payment-methods, .manual-mpesa { flex-direction: column; }

    .modal-content { padding: 1rem; }
}

@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr; }
}

/* =========================================================
   UTILITIES MANAGEMENT
   ========================================================= */

.utility-forms-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.utility-form-card {
    padding: 1.25rem;
}

.utility-form-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
}

.utility-form-header i {
    font-size: 1.1rem;
}

.utility-form-header h3 {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 600;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.utility-type-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.2rem 0.55rem;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.utility-type-badge.water {
    background: #e0f2fe;
    color: #0284c7;
}

.utility-type-badge.wifi {
    background: #f0fdf4;
    color: #16a34a;
}

/* =========================================================
   INVOICE / STATEMENT
   ========================================================= */

.invoice-document {
    padding: 0.5rem;
}

.invoice-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    border-bottom: 2px solid var(--border);
    padding-bottom: 1rem;
    margin-bottom: 1.25rem;
}

.invoice-tenant-info {
    display: flex;
    justify-content: space-between;
    background: var(--bg-main);
    padding: 1rem;
    border-radius: var(--radius-md);
    margin-bottom: 1.25rem;
}

.invoice-table {
    width: 100%;
    border-collapse: collapse;
}

.invoice-table th,
.invoice-table td {
    padding: 0.65rem 0.85rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
    font-size: 0.82rem;
}

.invoice-table th {
    background: var(--bg-main);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.7rem;
    letter-spacing: 0.04em;
    color: var(--text-muted);
}

.invoice-total-row td {
    border-top: 2px solid var(--text-main);
    padding-top: 0.85rem;
    font-weight: 700;
}

/* =========================================================
   TOAST NOTIFICATIONS
   ========================================================= */

.rms-toast {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.75rem 1.25rem;
    border-radius: var(--radius-md);
    font-size: 0.82rem;
    font-weight: 500;
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
    z-index: 9999;
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s ease;
    max-width: 380px;
}

.rms-toast.show {
    transform: translateY(0);
    opacity: 1;
}

.rms-toast-success {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
}

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

.rms-toast-info {
    background: #e0f2fe;
    color: #075985;
    border: 1px solid #bae6fd;
}

/* =========================================================
   RESPONSIVE — UTILITY ADDITIONS
   ========================================================= */

@media (max-width: 768px) {
    .utility-forms-row {
        grid-template-columns: 1fr;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .invoice-header,
    .invoice-tenant-info {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .invoice-tenant-info > div:last-child {
        text-align: left;
    }
}