/* ============================================================
   RentalSpaces - SuperAdmin Manage CSS
   ============================================================ */

:root {
    --rs-primary: #0B5C51;   /* CR-115: was navy #1E3A5F */
    --rs-accent: #10796A;    /* CR-115: was orange #F97316 */
    --rs-success: #10B981;
    --rs-error: #EF4444;
    --rs-warning: #F59E0B;
    --rs-info: #3B82F6;
    --rs-text: #1F2937;
    --rs-text-light: #6B7280;
    --rs-border: #E5E7EB;
    --rs-bg: #F3F4F6;
    --rs-bg-white: #FFFFFF;
    --rs-font: 'Inter', -apple-system, sans-serif;
    --rs-font-heading: 'Poppins', 'Inter', sans-serif;
    --rs-radius: 8px;
    --rs-radius-lg: 12px;
    --rs-shadow: 0 1px 3px rgba(0,0,0,0.1);
    --rs-shadow-md: 0 4px 6px rgba(0,0,0,0.07);
    --rs-shadow-lg: 0 10px 15px rgba(0,0,0,0.1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; }
body { font-family: var(--rs-font); color: var(--rs-text); background: var(--rs-bg); line-height: 1.6; }
a { color: var(--rs-primary); text-decoration: none; }
ul { list-style: none; }
[x-cloak] { display: none !important; }

/* Auth */
/* Sign-in screen.
   Was a narrow white card adrift in a flat navy field, with the brand reduced to a
   Unicode hexagon and a "SuperAdmin Panel" label set in white — on a white card, so
   it was never visible at all. That invisible line is why the card had an unexplained
   gap under the logo. */
.rs-manage-auth-body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    color: #fff;
    /* Depth rather than a flat fill, and a warm bloom off the brand accent so the
       page belongs to this product instead of being generic admin navy. */
    background:
        radial-gradient(58rem 34rem at 50% -12%, rgba(249, 115, 22, .16), transparent 62%),
        radial-gradient(46rem 30rem at 84% 108%, rgba(59, 130, 246, .14), transparent 60%),
        #16304f;
}
.rs-manage-auth-container { width: 100%; max-width: 26rem; }
.rs-manage-auth-card {
    background: var(--rs-bg-white);
    border-radius: 16px;
    padding: 2.25rem 2rem 2rem;
    width: 100%;
    /* Lifted off the ground rather than pasted on it: a wide soft shadow plus a
       hairline top highlight, which is what stops a white rectangle on dark from
       reading as a cut-out. */
    box-shadow: 0 24px 60px -12px rgba(8, 20, 36, .55), 0 2px 6px rgba(8, 20, 36, .25);
}
.rs-manage-auth-brand {
    display: flex;
    align-items: center;
    gap: .6rem;
    margin-bottom: 1.75rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--rs-border);
}
.rs-manage-auth-brand img { display: block; height: 40px; width: auto; }

.rs-manage-auth-head { margin-bottom: 1.5rem; }
.rs-manage-auth-head h1 {
    font-size: 1.45rem; font-weight: 700; color: var(--rs-primary);
    margin: 0 0 .25rem; letter-spacing: -.01em;
}
.rs-manage-auth-head p { font-size: .875rem; color: var(--rs-text-light); margin: 0; }

/* Reveal control sits inside the field rather than beside it, so the input keeps
   its full width and the row height does not change when it appears. */
.rs-manage-auth-pw { position: relative; }
.rs-manage-auth-pw .rs-input { padding-right: 4.25rem; }
.rs-manage-auth-pw-toggle {
    position: absolute; top: 50%; right: .6rem; transform: translateY(-50%);
    background: none; border: 0; padding: .25rem .4rem; cursor: pointer;
    font: inherit; font-size: .75rem; font-weight: 600; color: var(--rs-text-light);
    border-radius: 6px;
}
.rs-manage-auth-pw-toggle:hover { color: var(--rs-primary); background: var(--rs-bg); }
.rs-manage-auth-pw-toggle:focus-visible { outline: 2px solid var(--rs-accent); outline-offset: 1px; }

.rs-manage-auth-submit { margin-top: 1.25rem; min-height: 46px; font-size: .95rem; }
.rs-manage-auth-submit[disabled] { opacity: .65; cursor: default; }

.rs-manage-auth-foot {
    margin: 1.25rem 0 0; text-align: center;
    font-size: .78rem; color: rgba(255, 255, 255, .55);
}
.rs-manage-auth-foot a { color: rgba(255, 255, 255, .8); text-decoration: none; }
.rs-manage-auth-foot a:hover { text-decoration: underline; }

@media (max-width: 420px) {
    .rs-manage-auth-card { padding: 1.75rem 1.25rem 1.5rem; border-radius: 14px; }
}

/* Sidebar */
.rs-manage-body { display: flex; min-height: 100vh; }
.rs-manage-sidebar {
    width: 240px;
    background: #0F2340;
    color: white;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 200;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    transition: transform 0.3s ease;
}

.rs-manage-sidebar-header {
    padding: 1.25rem 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}
.rs-manage-brand { display: flex; flex-direction: column; align-items: flex-start; gap: 0.4rem; }
.rs-manage-brand img { display: block; height: 36px; width: auto; }
.rs-manage-brand-label { display: block; font-size: 0.7rem; color: rgba(255,255,255,0.5); text-transform: uppercase; letter-spacing: 1px; }

.rs-manage-nav { flex: 1; padding: 0.75rem; }
.rs-manage-nav-section { margin-bottom: 1.25rem; }
.rs-manage-nav-label {
    display: block;
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(255,255,255,0.35);
    padding: 0 0.875rem;
    margin-bottom: 0.375rem;
    font-weight: 600;
}
.rs-manage-link {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.55rem 0.875rem;
    border-radius: var(--rs-radius);
    color: rgba(255,255,255,0.65);
    font-size: 0.85rem;
    font-weight: 500;
    transition: background 0.15s, color 0.15s;
}
.rs-manage-link:hover { background: rgba(255,255,255,0.08); color: white; }
.rs-manage-link.active { background: rgba(249,115,22,0.2); color: var(--rs-accent); }
.rs-manage-logout { color: rgba(255,100,100,0.8) !important; }

/* Main Area */
.rs-manage-main {
    margin-left: 240px;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}
.rs-manage-topbar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--rs-bg-white);
    border-bottom: 1px solid var(--rs-border);
    height: 60px;
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    gap: 1rem;
    box-shadow: var(--rs-shadow);
}
.rs-manage-sidebar-toggle {
    background: none;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    color: var(--rs-text-light);
}
.rs-manage-topbar-title { flex: 1; }
.rs-manage-topbar-title h1 { font-size: 1.1rem; font-weight: 600; font-family: var(--rs-font-heading); }
.rs-manage-topbar-right { display: flex; align-items: center; gap: 0.75rem; }
.rs-manage-admin-badge {
    background: rgba(249,115,22,0.15);
    color: var(--rs-accent);
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
}
.rs-manage-admin-name { font-size: 0.875rem; font-weight: 600; }
.rs-manage-content { padding: 1.5rem; flex: 1; }

/* Stats */
.rs-stats-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; margin-bottom: 1.5rem; }
@media (min-width: 1200px) { .rs-stats-grid { grid-template-columns: repeat(4, 1fr); } }
.rs-stat-card { background: var(--rs-bg-white); border: 1px solid var(--rs-border); border-radius: var(--rs-radius-lg); padding: 1.25rem; border-left: 4px solid var(--rs-info); }
.rs-stat-label { font-size: 0.75rem; color: var(--rs-text-light); font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 0.5rem; }
.rs-stat-value { font-family: var(--rs-font-heading); font-size: 1.75rem; font-weight: 700; }

/* Cards */
.rs-card { background: var(--rs-bg-white); border: 1px solid var(--rs-border); border-radius: var(--rs-radius-lg); padding: 1.5rem; }
.rs-card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.25rem; padding-bottom: 1rem; border-bottom: 1px solid var(--rs-border); }
.rs-card-title { font-family: var(--rs-font-heading); font-size: 1rem; font-weight: 600; }

/* Table */
.rs-table-wrap { overflow-x: auto; }
.rs-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.rs-table th { padding: 0.7rem 1rem; text-align: left; font-weight: 600; color: var(--rs-text-light); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.5px; border-bottom: 2px solid var(--rs-border); white-space: nowrap; }
.rs-table td { padding: 0.875rem 1rem; border-bottom: 1px solid var(--rs-border); vertical-align: middle; }
.rs-table tr:last-child td { border-bottom: none; }
.rs-table tr:hover td { background: var(--rs-bg); }

/* Buttons */
.rs-btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; padding: 0.5rem 1.25rem; border-radius: var(--rs-radius); font-size: 0.85rem; font-weight: 600; cursor: pointer; border: 2px solid transparent; transition: all 0.15s; text-decoration: none; white-space: nowrap; }
.rs-btn-primary { background: var(--rs-accent); color: white; border-color: var(--rs-accent); }
.rs-btn-primary:hover { background: #0B5C51; color: white; }
.rs-btn-secondary { background: var(--rs-primary); color: white; border-color: var(--rs-primary); }
.rs-btn-success { background: var(--rs-success); color: white; border-color: var(--rs-success); }
.rs-btn-danger { background: var(--rs-error); color: white; border-color: var(--rs-error); }
.rs-btn-ghost { background: transparent; color: var(--rs-text); border-color: var(--rs-border); }
.rs-btn-ghost:hover { background: var(--rs-bg); }
.rs-btn-sm { padding: 0.3rem 0.75rem; font-size: 0.8rem; }

/* Badges */
.rs-badge { display: inline-flex; align-items: center; padding: 0.2rem 0.6rem; border-radius: 20px; font-size: 0.7rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.4px; }
.rs-badge-success { background: #D1FAE5; color: #065F46; }
.rs-badge-error { background: #FEE2E2; color: #991B1B; }
.rs-badge-warning { background: #FEF3C7; color: #92400E; }
.rs-badge-info { background: #DBEAFE; color: #1E40AF; }
.rs-badge-gray { background: #F3F4F6; color: #374151; }

/* Alerts */
.rs-alert { padding: 0.875rem 1.25rem; border-radius: var(--rs-radius); font-size: 0.875rem; font-weight: 500; margin-bottom: 1rem; }
.rs-alert--success { background: #D1FAE5; color: #065F46; }
.rs-alert--error { background: #FEE2E2; color: #991B1B; }

/* Forms */
.rs-form-group { margin-bottom: 1.25rem; }
.rs-label { display: block; font-size: 0.85rem; font-weight: 500; margin-bottom: 0.375rem; }
.rs-input, .rs-select, .rs-textarea { width: 100%; padding: 0.6rem 0.875rem; border: 1.5px solid var(--rs-border); border-radius: var(--rs-radius); font-size: 0.875rem; font-family: var(--rs-font); color: var(--rs-text); background: var(--rs-bg-white); transition: border-color 0.15s; outline: none; appearance: none; }
.rs-input:focus, .rs-select:focus, .rs-textarea:focus { border-color: var(--rs-primary); box-shadow: 0 0 0 3px rgba(30,58,95,0.1); }
.rs-textarea { min-height: 100px; resize: vertical; }

/* Workflow Builder */
.rs-workflow-trigger { background: #EBF4FF; border: 2px dashed #93C5FD; border-radius: var(--rs-radius-lg); padding: 1.25rem; margin-bottom: 1rem; }
.rs-workflow-step { background: var(--rs-bg-white); border: 1px solid var(--rs-border); border-radius: var(--rs-radius); padding: 1rem; margin-bottom: 0.75rem; display: flex; align-items: center; gap: 1rem; }
.rs-workflow-connector { text-align: center; color: var(--rs-text-light); font-size: 1.25rem; margin: 0.25rem 0; }

/* Utilities */
.container { max-width: 1400px; margin: 0 auto; padding: 0 1.5rem; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.mt-4 { margin-top: 1rem; }
.mb-4 { margin-bottom: 1rem; }
.mt-8 { margin-top: 2rem; }
.mb-8 { margin-bottom: 2rem; }
.gap-4 { gap: 1rem; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.hidden { display: none !important; }
[x-cloak] { display: none !important; }

/* WhatsApp inventory (CR-109). rs-table and rs-badge already existed; these are the
   pieces that screen adds — status tabs, the page heading and the pager. Scoped names
   so nothing else on the panel shifts. */
.rs-page-head h1 { margin: 0 0 4px; font-size: 1.35rem; }
.rs-page-head p  { margin: 0 0 14px; font-size: .875rem; }
.rs-tabs { display: flex; gap: 4px; margin: 0 0 16px; border-bottom: 1px solid #e2e8f0; }
.rs-tab { padding: 8px 14px; font-size: .875rem; text-decoration: none; color: #64748b;
          border-bottom: 2px solid transparent; }
.rs-tab:hover { color: #0f172a; }
.rs-tab.active { color: #05164d; border-bottom-color: #05164d; font-weight: 600; }
.rs-muted { color: #64748b; font-size: .8125rem; }
.rs-nowrap { white-space: nowrap; }
.rs-wrap { white-space: normal; }
.rs-empty { padding: 32px; text-align: center; color: #64748b; }
.rs-badge-warn { background: #fef3c7; color: #92400e; }
.rs-pager { display: flex; gap: 6px; margin-top: 16px; flex-wrap: wrap; }
.rs-pager a { padding: 5px 10px; border: 1px solid #e2e8f0; border-radius: 4px;
              text-decoration: none; color: #334155; font-size: .8125rem; }
.rs-pager a.active { background: #05164d; color: #fff; border-color: #05164d; }

/* Sign-in by emailed code: one line of explanation and a quiet secondary action.
   The password field and its reveal toggle are gone — the inbox is the credential. */
.rs-manage-auth-note {
    margin: 0 0 1.1rem;
    color: #6B7280;
    font-size: .92rem;
    line-height: 1.5;
}
.rs-manage-auth-link {
    display: block;
    width: 100%;
    margin-top: .7rem;
    padding: .5rem;
    background: none;
    border: 0;
    color: #6B7280;
    font-size: .9rem;
    cursor: pointer;
}
.rs-manage-auth-link:hover { color: #0B5C51; text-decoration: underline; }
