/* ==========================================================================
   مُستأجِر - نظام إدارة المستأجرين والعقارات
   Modern Luxury Real Estate Management Design System
   ========================================================================== */

:root {
  /* Color Palette */
  --brand-primary: #0d9488;
  --brand-primary-hover: #0f766e;
  --brand-primary-light: #f0fdfa;
  --brand-primary-ring: rgba(13, 148, 136, 0.25);
  --brand-accent: #3b82f6;
  --brand-gold: #d97706;
  --brand-gold-light: #fef3c7;
  
  --bg-canvas: #f8fafc;
  --bg-surface: #ffffff;
  --bg-sidebar: #0f172a;
  --bg-sidebar-card: #1e293b;
  --bg-sidebar-hover: #1e293b;
  
  --text-main: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --text-inverse: #ffffff;
  
  --border-subtle: #e2e8f0;
  --border-medium: #cbd5e1;
  --border-focus: #0d9488;
  
  --status-success: #10b981;
  --status-success-bg: #ecfdf5;
  --status-warning: #f59e0b;
  --status-warning-bg: #fffbeb;
  --status-danger: #ef4444;
  --status-danger-bg: #fef2f2;
  --status-info: #06b6d4;
  --status-info-bg: #ecfeff;
  
  /* Shadows */
  --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.07), 0 1px 2px -1px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(15, 23, 42, 0.06), 0 4px 6px -4px rgba(15, 23, 42, 0.03);
  --shadow-xl: 0 20px 25px -5px rgba(15, 23, 42, 0.08), 0 8px 10px -6px rgba(15, 23, 42, 0.04);
  --shadow-glow: 0 0 25px rgba(13, 148, 136, 0.2);
  
  /* Radii */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-full: 9999px;
  
  /* Transitions */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* Base & Typography */
body {
  font-family: 'Tajawal', 'Cairo', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif !important;
  background-color: var(--bg-canvas) !important;
  color: var(--text-main) !important;
  min-height: 100vh;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.6;
}

h1, h2, h3, h4, h5, h6, .page-title, .h1, .h2, .h3, .h4, .h5, .h6 {
  font-family: 'Tajawal', 'Cairo', system-ui, sans-serif !important;
  font-weight: 700 !important;
  color: var(--text-main) !important;
  letter-spacing: -0.01em;
}

/* Layout Shell */
.app-layout {
  display: flex;
  min-height: 100vh;
  width: 100%;
  position: relative;
}

/* Sidebar Styling */
.sidebar, nav.sidebar {
  background: linear-gradient(180deg, #0b1324 0%, #111c35 100%) !important;
  color: #e2e8f0 !important;
  box-shadow: 4px 0 24px rgba(0, 0, 0, 0.12) !important;
  min-height: 100vh;
  z-index: 1000;
  padding: 0 !important;
  display: flex;
  flex-direction: column;
  transition: all var(--transition-normal);
  border: none !important;
  border-left: 1px solid rgba(255, 255, 255, 0.05) !important;
}

/* Sidebar Brand Header */
.sidebar-brand {
  padding: 1.75rem 1.25rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(0, 0, 0, 0.15);
}

.sidebar-brand-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #0d9488 0%, #06b6d4 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.35rem;
  box-shadow: 0 4px 12px rgba(13, 148, 136, 0.35);
  flex-shrink: 0;
}

.sidebar-brand-text h4 {
  color: #ffffff !important;
  font-size: 1.2rem !important;
  font-weight: 800 !important;
  margin: 0 !important;
  line-height: 1.2;
}

.sidebar-brand-text span {
  font-size: 0.75rem;
  color: #94a3b8;
  font-weight: 500;
}

/* Sidebar Navigation */
.sidebar .nav {
  padding: 1rem 0.75rem !important;
  gap: 0.35rem;
  flex: 1;
}

.sidebar-section-title {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #64748b;
  padding: 0.75rem 0.85rem 0.35rem;
  margin: 0;
}

.sidebar .nav-link {
  color: #cbd5e1 !important;
  font-size: 0.95rem;
  font-weight: 600;
  padding: 0.75rem 1rem !important;
  border-radius: var(--radius-md) !important;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  transition: all var(--transition-fast) !important;
  position: relative;
  text-decoration: none;
}

.sidebar .nav-link i {
  font-size: 1.1rem;
  width: 26px;
  margin-left: 0.75rem !important;
  margin-right: 0 !important;
  text-align: center;
  color: #94a3b8;
  transition: all var(--transition-fast);
}

.sidebar .nav-link:hover {
  color: #ffffff !important;
  background: rgba(255, 255, 255, 0.08) !important;
  transform: translateX(-4px);
}

.sidebar .nav-link:hover i {
  color: #38bdf8;
}

.sidebar .nav-link.active {
  color: #ffffff !important;
  background: linear-gradient(90deg, #0d9488 0%, #0f766e 100%) !important;
  box-shadow: 0 4px 14px rgba(13, 148, 136, 0.35) !important;
}

.sidebar .nav-link.active i {
  color: #ffffff !important;
}

/* Sidebar User Footer */
.sidebar-user {
  padding: 1rem 1.25rem;
  margin: 0.75rem;
  background: rgba(255, 255, 255, 0.04);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.sidebar-user-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #1e293b;
  border: 2px solid #0d9488;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #e2e8f0;
  font-size: 1rem;
  flex-shrink: 0;
}

.sidebar-user-info {
  flex: 1;
  overflow: hidden;
}

.sidebar-user-name {
  color: #ffffff;
  font-size: 0.85rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin: 0;
}

.sidebar-user-role {
  color: #0d9488;
  font-size: 0.72rem;
  font-weight: 600;
  margin: 0;
}

.sidebar-logout-btn {
  color: #94a3b8;
  background: transparent;
  border: none;
  padding: 0.4rem;
  font-size: 1.1rem;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

.sidebar-logout-btn:hover {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.1);
}

/* Main Content Area */
.main-content, main.main-content {
  background: var(--bg-canvas) !important;
  min-height: 100vh;
  padding: 0 !important;
  display: flex;
  flex-direction: column;
}

.content-wrapper {
  padding: 1.75rem 2rem !important;
  flex: 1;
}

/* Top App Header / Navbar */
.app-topbar {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
  padding: 0.9rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
}

.topbar-title-group h2 {
  font-size: 1.35rem !important;
  margin: 0 !important;
  font-weight: 700 !important;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.topbar-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 0;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Cards & Widgets */
.card {
  background: var(--bg-surface) !important;
  border: 1px solid var(--border-subtle) !important;
  border-radius: var(--radius-lg) !important;
  box-shadow: var(--shadow-sm) !important;
  transition: all var(--transition-normal) !important;
  overflow: hidden;
  margin-bottom: 1.5rem !important;
}

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

.card-header {
  background: var(--bg-surface) !important;
  border-bottom: 1px solid var(--border-subtle) !important;
  padding: 1.1rem 1.35rem !important;
  font-weight: 700 !important;
  font-size: 1.05rem !important;
  color: var(--text-main) !important;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-body {
  padding: 1.35rem !important;
}

/* Metric / Stat Cards */
.stat-card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  background: var(--bg-surface);
  padding: 1.35rem 1.25rem;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-normal);
  display: flex;
  align-items: center;
  gap: 1.15rem;
}

.stat-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(13, 148, 136, 0.3);
}

.stat-card-icon {
  width: 54px;
  height: 54px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
  transition: all var(--transition-fast);
}

.stat-card:hover .stat-card-icon {
  transform: scale(1.08);
}

.stat-icon-teal {
  background: linear-gradient(135deg, #f0fdfa 0%, #ccfbf1 100%);
  color: #0d9488;
}

.stat-icon-blue {
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
  color: #2563eb;
}

.stat-icon-amber {
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
  color: #d97706;
}

.stat-icon-emerald {
  background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
  color: #059669;
}

.stat-card-content {
  flex: 1;
}

.stat-card-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  margin: 0 0 0.25rem;
}

.stat-card-value {
  font-size: 1.85rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.1;
  margin: 0;
}

.stat-card-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-full);
  margin-top: 0.35rem;
}

/* Buttons */
.btn {
  font-family: 'Tajawal', 'Cairo', system-ui, sans-serif !important;
  font-weight: 600 !important;
  font-size: 0.9rem !important;
  padding: 0.55rem 1.15rem !important;
  border-radius: var(--radius-md) !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: all var(--transition-fast) !important;
  border: 1px solid transparent !important;
}

.btn:active {
  transform: scale(0.98);
}

/* Enforce Bootstrap display utilities over buttons & flex items */
.d-none { display: none !important; }
@media (min-width: 576px) { .d-sm-none { display: none !important; } }
@media (min-width: 768px) { .d-md-none { display: none !important; } }
@media (min-width: 992px) { .d-lg-none { display: none !important; } }
@media (min-width: 1200px) { .d-xl-none { display: none !important; } }
@media (min-width: 1400px) { .d-xxl-none { display: none !important; } }

.btn-primary {
  background: linear-gradient(135deg, #0d9488 0%, #0f766e 100%) !important;
  color: #ffffff !important;
  border-color: #0d9488 !important;
  box-shadow: 0 2px 8px rgba(13, 148, 136, 0.25) !important;
}

.btn-primary:hover {
  background: linear-gradient(135deg, #0f766e 0%, #115e59 100%) !important;
  box-shadow: 0 4px 12px rgba(13, 148, 136, 0.35) !important;
  color: #ffffff !important;
}

.btn-outline-primary {
  color: #0d9488 !important;
  border-color: #0d9488 !important;
  background: transparent !important;
}

.btn-outline-primary:hover {
  background: #0d9488 !important;
  color: #ffffff !important;
}

.btn-success {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
  color: #ffffff !important;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.25) !important;
}

.btn-success:hover {
  background: linear-gradient(135deg, #059669 0%, #047857 100%) !important;
  color: #ffffff !important;
}

.btn-warning {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%) !important;
  color: #ffffff !important;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.25) !important;
}

.btn-warning:hover {
  background: linear-gradient(135deg, #d97706 0%, #b45309 100%) !important;
  color: #ffffff !important;
}

.btn-info {
  background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%) !important;
  color: #ffffff !important;
  box-shadow: 0 2px 8px rgba(6, 182, 212, 0.25) !important;
}

.btn-info:hover {
  background: linear-gradient(135deg, #0891b2 0%, #0e7490 100%) !important;
  color: #ffffff !important;
}

.btn-danger {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%) !important;
  color: #ffffff !important;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.25) !important;
}

.btn-danger:hover {
  background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%) !important;
  color: #ffffff !important;
}

.btn-secondary {
  background: #f1f5f9 !important;
  color: var(--text-secondary) !important;
  border-color: var(--border-subtle) !important;
}

.btn-secondary:hover {
  background: #e2e8f0 !important;
  color: var(--text-main) !important;
}

/* Forms & Inputs */
.form-label {
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--text-main);
  margin-bottom: 0.4rem;
}

.form-control, .form-select {
  font-family: 'Tajawal', 'Cairo', system-ui, sans-serif !important;
  font-size: 0.92rem !important;
  border-radius: var(--radius-md) !important;
  border: 1.5px solid var(--border-subtle) !important;
  padding: 0.65rem 0.95rem !important;
  color: var(--text-main) !important;
  background-color: #ffffff !important;
  transition: all var(--transition-fast) !important;
}

.form-control:focus, .form-select:focus {
  border-color: var(--brand-primary) !important;
  box-shadow: 0 0 0 3px var(--brand-primary-ring) !important;
  outline: none !important;
}

/* Tables (Compliant with responsive-table guide) */
.table-wrapper {
  overflow: auto;
  max-inline-size: 100%;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  box-shadow: var(--shadow-sm);
  margin-bottom: 1.5rem;
}

.table {
  width: 100%;
  margin-bottom: 0 !important;
  border-collapse: separate;
  border-spacing: 0;
  color: var(--text-main) !important;
}

.table thead th {
  background: #f8fafc !important;
  color: #475569 !important;
  font-size: 0.82rem !important;
  font-weight: 700 !important;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.9rem 1.1rem !important;
  border-bottom: 1px solid var(--border-subtle) !important;
  border-top: none !important;
  white-space: nowrap;
}

.table tbody tr {
  transition: background-color var(--transition-fast);
}

.table tbody tr:hover {
  background-color: rgba(240, 253, 250, 0.4) !important;
}

.table tbody td, .table tbody th {
  padding: 0.95rem 1.1rem !important;
  border-bottom: 1px solid var(--border-subtle) !important;
  border-top: none !important;
  vertical-align: middle;
  font-size: 0.9rem;
}

.table tbody tr:last-child td, .table tbody tr:last-child th {
  border-bottom: none !important;
}

/* Badges & Chips */
.badge {
  font-family: 'Tajawal', 'Cairo', system-ui, sans-serif !important;
  font-weight: 700 !important;
  font-size: 0.75rem !important;
  padding: 0.35rem 0.75rem !important;
  border-radius: var(--radius-full) !important;
  letter-spacing: 0.02em;
}

.badge-active {
  background: #ecfdf5 !important;
  color: #065f46 !important;
  border: 1px solid #a7f3d0;
}

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

.badge-expired {
  background: #fef2f2 !important;
  color: #991b1b !important;
  border: 1px solid #fecaca;
}

/* Tenant Avatar Pill */
.tenant-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0d9488 0%, #14b8a6 100%);
  color: white;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  margin-left: 0.6rem;
  box-shadow: 0 2px 6px rgba(13, 148, 136, 0.25);
  flex-shrink: 0;
}

/* ==========================================================================
   Image 2 Design: Floating Luxury Auth Card Modal (Login & Forgot Password)
   ========================================================================== */
.auth-page-body {
  background: radial-gradient(circle at 50% 25%, #101935 0%, #060a14 100%) !important;
  min-height: 100vh;
  margin: 0;
  padding: 2.5rem 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Tajawal', sans-serif !important;
  position: relative;
  overflow-x: hidden;
}

.auth-page-body::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 32px 32px;
  pointer-events: none;
}

.auth-card-modal {
  max-width: 960px;
  width: 100%;
  min-height: 520px;
  border-radius: 24px;
  overflow: hidden;
  display: flex;
  box-shadow: 0 25px 70px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(255, 255, 255, 0.08);
  background: #ffffff;
  position: relative;
  z-index: 10;
}

/* Right Side: Dark Indigo Pillar */
.auth-card-dark {
  flex: 0 0 46%;
  max-width: 46%;
  background: linear-gradient(145deg, #101a36 0%, #161c3c 100%);
  color: #ffffff;
  padding: 2.5rem 2.25rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border-left: 1px solid rgba(255, 255, 255, 0.06);
  position: relative;
}

.auth-card-dark::before {
  content: "";
  position: absolute;
  top: -80px;
  right: -80px;
  width: 250px;
  height: 250px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.15) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

.dark-top-badges {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}

.tag-pill-dark {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  padding: 4px 12px;
  font-size: 0.74rem;
  color: #cbd5e1;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.brand-center-block {
  text-align: center;
  margin-bottom: 1.75rem;
}

.brand-logo-container {
  width: 72px;
  height: 72px;
  border-radius: 20px;
  margin: 0 auto 1.15rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  overflow: hidden;
  background: #09132b;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid rgba(255, 255, 255, 0.12);
}

.brand-logo-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.brand-dark-title {
  color: #ffffff !important;
  font-size: 1.6rem !important;
  font-weight: 800 !important;
  margin: 0 0 0.35rem;
  letter-spacing: -0.02em;
}

.brand-dark-subtitle {
  color: #94a3b8 !important;
  font-size: 0.84rem;
  line-height: 1.55;
  margin: 0 auto;
  max-width: 320px;
}

.auth-feature-row {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 0.85rem 1.15rem;
  margin-bottom: 0.85rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: all 0.2s ease;
}

.auth-feature-row:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(99, 102, 241, 0.3);
}

.icon-box-feature {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  flex-shrink: 0;
  color: #ffffff;
}

.icon-box-purple {
  background: linear-gradient(135deg, #4f46e5 0%, #6366f1 100%);
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.35);
}

.icon-box-cyan {
  background: linear-gradient(135deg, #0284c7 0%, #06b6d4 100%);
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.35);
}

.feature-row-title {
  color: #ffffff;
  font-weight: 700;
  font-size: 0.88rem;
  margin-bottom: 0.15rem;
}

.feature-row-desc {
  color: #94a3b8;
  font-size: 0.76rem;
  line-height: 1.4;
  margin: 0;
}

.dark-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
  padding-top: 1.5rem;
  color: #64748b;
  font-size: 0.76rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

/* Left Side: Clean White Auth Card */
.auth-card-light {
  flex: 1;
  background: #ffffff;
  padding: 2.25rem 2.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
}

.light-top-badges {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
}

.tag-pill-green {
  background: #ecfdf5;
  color: #059669;
  border: 1px solid #d1fae5;
  border-radius: 20px;
  padding: 4px 12px;
  font-size: 0.74rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.tag-pill-green .pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.25);
}

.tag-pill-lang {
  background: #ffffff;
  color: #475569;
  border: 1px solid #e2e8f0;
  border-radius: 20px;
  padding: 4px 11px;
  font-size: 0.74rem;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.form-center-block {
  text-align: center;
  margin-bottom: 1.5rem;
}

.form-logo-box {
  width: 58px;
  height: 58px;
  border-radius: 16px;
  margin: 0 auto 0.75rem;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
  overflow: hidden;
  background: #09132b;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.form-logo-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.form-main-title {
  color: #0f172a !important;
  font-size: 1.55rem !important;
  font-weight: 800 !important;
  margin: 0 0 0.25rem;
  letter-spacing: -0.02em;
}

.form-main-subtitle {
  color: #64748b !important;
  font-size: 0.85rem;
  margin: 0;
  line-height: 1.45;
}

.auth-soft-field {
  margin-bottom: 1.15rem;
}

.auth-soft-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: #334155;
  margin-bottom: 0.35rem;
  display: block;
  text-align: right;
}

.auth-soft-input-wrapper {
  position: relative;
}

.auth-soft-input-wrapper .form-control {
  background: #edf3fa !important;
  border: 1.5px solid transparent !important;
  border-radius: 10px !important;
  padding: 0.72rem 2.6rem 0.72rem 1rem !important;
  font-size: 0.92rem !important;
  color: #0f172a !important;
  font-family: 'Tajawal', sans-serif !important;
  font-weight: 500 !important;
  transition: all 0.2s ease !important;
}

.auth-soft-input-wrapper .form-control:focus {
  background: #ffffff !important;
  border-color: #6366f1 !important;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.16) !important;
}

.auth-soft-input-wrapper .soft-input-icon {
  position: absolute;
  right: 0.95rem;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  font-size: 0.98rem;
  pointer-events: none;
  transition: color 0.2s ease;
  z-index: 2;
}

.auth-soft-input-wrapper:focus-within .soft-input-icon {
  color: #4f46e5;
}

.auth-soft-input-wrapper .soft-eye-btn {
  position: absolute;
  left: 0.95rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 0.98rem;
  cursor: pointer;
  padding: 0;
  z-index: 2;
  transition: color 0.2s ease;
}

.auth-soft-input-wrapper .soft-eye-btn:hover {
  color: #0f172a;
}

.auth-purple-btn {
  background: linear-gradient(135deg, #4f46e5 0%, #6366f1 100%) !important;
  color: #ffffff !important;
  font-size: 1rem !important;
  font-weight: 700 !important;
  padding: 0.8rem 1.5rem !important;
  border-radius: 10px !important;
  border: none !important;
  width: 100%;
  box-shadow: 0 6px 20px rgba(79, 70, 229, 0.38) !important;
  margin-top: 1rem;
  transition: all 0.2s ease !important;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.auth-purple-btn:hover {
  background: linear-gradient(135deg, #4338ca 0%, #4f46e5 100%) !important;
  transform: translateY(-1px);
  box-shadow: 0 8px 25px rgba(79, 70, 229, 0.45) !important;
}

.light-card-footer {
  text-align: center;
  color: #64748b;
  font-size: 0.74rem;
  margin-top: 1rem;
}

@media (max-width: 860px) {
  .auth-card-modal {
    flex-direction: column;
    max-width: 480px;
    margin: 1rem auto;
  }
  
  .auth-card-dark {
    flex: 0 0 auto;
    max-width: 100%;
    width: 100%;
    padding: 1.75rem 1.5rem;
    text-align: center;
    border-left: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }

  .auth-feature-row, .dark-card-footer {
    display: none;
  }

  .auth-card-light {
    padding: 2rem 1.5rem;
  }
}

/* Footer Minimal & Clean */
footer.app-footer {
  background: transparent !important;
  color: var(--text-muted) !important;
  font-size: 0.82rem;
  padding: 1.5rem 0;
  text-align: center;
  border-top: 1px solid var(--border-subtle);
  margin-top: auto;
}

footer.app-footer a {
  color: var(--brand-primary);
  text-decoration: none;
  font-weight: 600;
}

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

/* Modern Alerts */
.alert {
  border-radius: var(--radius-md) !important;
  border: none !important;
  font-weight: 600 !important;
  font-size: 0.9rem !important;
  padding: 0.9rem 1.25rem !important;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.alert-danger {
  background: var(--status-danger-bg) !important;
  color: #991b1b !important;
  border-right: 4px solid var(--status-danger) !important;
}

.alert-success {
  background: var(--status-success-bg) !important;
  color: #065f46 !important;
  border-right: 4px solid var(--status-success) !important;
}

.alert-warning {
  background: var(--status-warning-bg) !important;
  color: #92400e !important;
  border-right: 4px solid var(--status-warning) !important;
}

/* ==========================================================================
   Responsive Architecture & Bulletproof Mobile/Tablet Sidebar Drawer
   ========================================================================== */

/* Mobile & Tablet Mode (< 992px: Phones, iPad, Tablets) */
@media (max-width: 991.98px) {
  /* Main content takes 100% width completely unhindered */
  .main-content, main.main-content {
    width: 100% !important;
    max-width: 100% !important;
    flex: 0 0 100% !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  .content-wrapper {
    padding: 1rem !important;
  }
  
  .app-topbar {
    padding: 0.75rem 1rem !important;
  }

  /* Hamburger Toggle Button - visible on mobile */
  .sidebar-toggle-btn,
  button[onclick*="toggleSidebarMenu"] {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
  }

  /* Close Button in Sidebar Brand - visible on mobile */
  .sidebar-close-btn,
  #sidebarCloseBtn,
  button[onclick*="toggleSidebarMenu(true)"] {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
  }

  /* Closed mobile sidebar: completely removed from layout flow via fixed positioning and shifted offscreen to the right */
  .sidebar, nav.sidebar, #sidebarMenu {
    position: fixed !important;
    top: 0 !important;
    right: -330px !important;
    left: auto !important;
    bottom: 0 !important;
    width: 290px !important;
    max-width: 85vw !important;
    height: 100vh !important;
    height: 100dvh !important;
    z-index: 1080 !important;
    transform: none !important;
    -webkit-transform: none !important;
    transition: right 0.28s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.28s ease !important;
    visibility: hidden !important;
    pointer-events: none !important;
    display: flex !important;
    flex-direction: column !important;
    box-shadow: none !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    margin: 0 !important;
    border-left: 1px solid rgba(255, 255, 255, 0.08) !important;
  }

  /* Open mobile sidebar: slides in smoothly from the right (right: 0) */
  .sidebar.show-mobile, nav.sidebar.show-mobile, #sidebarMenu.show-mobile {
    right: 0 !important;
    left: auto !important;
    transform: none !important;
    -webkit-transform: none !important;
    visibility: visible !important;
    pointer-events: auto !important;
    box-shadow: -10px 0 45px rgba(0, 0, 0, 0.75) !important;
  }

  /* Dark Blurred Backdrop */
  .sidebar-backdrop {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    background: rgba(15, 23, 42, 0.75) !important;
    backdrop-filter: blur(4px) !important;
    -webkit-backdrop-filter: blur(4px) !important;
    z-index: 1070 !important;
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
    transition: opacity 0.25s ease, visibility 0.25s ease !important;
    display: none;
  }

  .sidebar-backdrop.show {
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
  }

  /* Lock body scroll when mobile drawer is open */
  body.sidebar-drawer-open {
    overflow: hidden !important;
  }

  .stat-card {
    padding: 1rem !important;
  }
  
  .stat-card-value {
    font-size: 1.5rem !important;
  }
}

/* Desktop Mode (>= 992px: Laptops, Desktops, Landscape Tablets) */
@media (min-width: 992px) {
  .sidebar, nav.sidebar, #sidebarMenu {
    position: static !important;
    top: auto !important;
    right: auto !important;
    left: auto !important;
    bottom: auto !important;
    transform: none !important;
    -webkit-transform: none !important;
    visibility: visible !important;
    pointer-events: auto !important;
    display: flex !important;
    flex-direction: column !important;
    min-height: 100vh !important;
    width: 260px !important;
    min-width: 260px !important;
    max-width: 260px !important;
    flex: 0 0 260px !important;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.12) !important;
  }

  .main-content, main.main-content {
    flex: 1 1 0 !important;
    min-width: 0 !important;
    width: calc(100% - 260px) !important;
    max-width: calc(100% - 260px) !important;
  }

  /* Strictly hide all mobile menu toggle and close buttons on desktop */
  .sidebar-toggle-btn,
  .sidebar-close-btn,
  #sidebarCloseBtn,
  button[onclick*="toggleSidebarMenu"],
  .d-lg-none {
    display: none !important;
  }

  .sidebar-backdrop {
    display: none !important;
  }
}

/* ==========================================================================
   Header Notification Bell & Admin Profile Dropdown
   ========================================================================== */

.btn-icon-round {
  width: 42px;
  height: 42px;
  border-radius: 50% !important;
  background: #ffffff !important;
  border: 1px solid var(--border-subtle) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 0 !important;
  color: var(--text-secondary) !important;
  box-shadow: var(--shadow-xs) !important;
  transition: all var(--transition-fast) !important;
}

.btn-icon-round:hover {
  background: #f1f5f9 !important;
  color: var(--brand-primary) !important;
  border-color: var(--brand-primary) !important;
  transform: translateY(-1px);
}

.notif-dropdown-menu {
  border-radius: var(--radius-lg) !important;
  overflow: hidden;
  animation: fadeInDown 0.2s ease-out;
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.notif-item {
  transition: background-color var(--transition-fast);
  cursor: pointer;
}

.notif-item:hover {
  background-color: #f8fafc;
}

.notif-item.unread {
  background-color: rgba(240, 253, 250, 0.7);
}

.notif-icon-circle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.unread-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #0d9488;
  display: inline-block;
  box-shadow: 0 0 6px rgba(13, 148, 136, 0.5);
}

/* Header Avatar */
.header-user-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid var(--brand-primary);
  box-shadow: 0 2px 6px rgba(13, 148, 136, 0.25);
  background: #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all var(--transition-fast);
}

.header-user-avatar:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(13, 148, 136, 0.35);
}

.header-user-avatar .avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Profile Page Avatar */
.profile-main-avatar {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid var(--brand-primary);
  box-shadow: var(--shadow-lg);
  background: #f8fafc;
}

.avatar-upload-badge {
  position: absolute;
  bottom: 4px;
  right: 4px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--brand-primary);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  cursor: pointer;
  border: 3px solid #ffffff;
  box-shadow: var(--shadow-md);
  transition: all var(--transition-fast);
}

.avatar-upload-badge:hover {
  background: var(--brand-primary-hover);
  transform: scale(1.1);
}

/* ==========================================================================
   Tenant Profile & Detail View Styling
   ========================================================================== */
.tenant-hero-card {
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 1.75rem 2rem;
  box-shadow: var(--shadow-sm);
  margin-bottom: 1.5rem;
  position: relative;
  overflow: hidden;
}

.tenant-hero-card::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--brand-primary) 0%, var(--teal-500) 50%, var(--amber-500) 100%);
}

.tenant-hero-avatar {
  width: 76px;
  height: 76px;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, var(--brand-primary) 0%, var(--teal-600) 100%);
  color: #ffffff;
  font-size: 2.2rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(13, 148, 136, 0.35);
  flex-shrink: 0;
}

.tenant-quick-stat {
  background: #f8fafc;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.15rem;
  height: 100%;
  transition: all var(--transition-fast);
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

.tenant-quick-stat:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
  border-color: var(--teal-300);
}

.quick-stat-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}

.quick-stat-icon.blue { background: #eff6ff; color: #2563eb; }
.quick-stat-icon.green { background: #f0fdf4; color: #16a34a; }
.quick-stat-icon.amber { background: #fffbeb; color: #d97706; }
.quick-stat-icon.teal { background: #f0fdfa; color: #0d9488; }

/* Modern Tabs according to modern-web-guidance */
.modern-tabs-nav {
  display: flex;
  overflow-x: auto;
  gap: 0.5rem;
  border-bottom: 2px solid var(--border-subtle);
  margin-bottom: 1.5rem;
  padding-bottom: 2px;
  scrollbar-width: thin;
}

.modern-tab-btn {
  padding: 0.75rem 1.25rem;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-muted);
  background: transparent;
  border: none;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  position: relative;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  white-space: nowrap;
  transition: all var(--transition-fast);
}

.modern-tab-btn:hover {
  color: var(--brand-primary);
  background: #f8fafc;
}

.modern-tab-btn[aria-selected="true"] {
  color: var(--brand-primary);
  background: #f0fdfa;
}

/* Accessible underline indicator per WCAG 1.4.1 */
.modern-tab-btn[aria-selected="true"]::after {
  content: "";
  position: absolute;
  inset-inline: 0;
  bottom: -2px;
  height: 3px;
  background: var(--brand-primary);
  border-radius: 3px 3px 0 0;
}

.modern-tab-panel {
  display: block;
}

.modern-tab-panel[hidden] {
  display: none !important;
}

/* Document & Attachment Cards */
.doc-card {
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-fast);
  display: flex;
  flex-direction: column;
  height: 100%;
}

.doc-card:hover {
  border-color: var(--brand-primary);
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.doc-card-preview {
  height: 200px;
  background: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
  cursor: pointer;
}

.doc-card-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-medium);
}

.doc-card-preview:hover img {
  transform: scale(1.04);
}

.doc-card-preview .zoom-overlay {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  color: #ffffff;
  font-weight: 600;
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.doc-card-preview:hover .zoom-overlay {
  opacity: 1;
}

.doc-card-body {
  padding: 1rem 1.25rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  flex-grow: 1;
}

/* Contract Paper Container */
.contract-paper-preview {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-md);
  padding: 2.5rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
  min-height: 500px;
  max-height: 800px;
  overflow-y: auto;
  font-family: 'Cairo', 'Tajawal', sans-serif;
  line-height: 1.8;
  position: relative;
}

/* Reports Specific Cards */
.report-stat-card {
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-fast);
}

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

.report-stat-icon {
  width: 58px;
  height: 58px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  flex-shrink: 0;
}

.filter-glass-card {
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
  padding: 1.5rem 1.75rem;
  margin-bottom: 1.75rem;
}
