/* ==========================================================================
   DESIGN SYSTEM & CUSTOM VARIABLES
   ========================================================================== */
:root {
  /* Color Palette - Cinematic Dark Theme */
  --bg-color: #08090c;
  --bg-gradient: radial-gradient(circle at 50% 0%, #151a2d 0%, #08090c 70%);
  --card-bg: rgba(18, 22, 33, 0.6);
  --card-border: rgba(255, 255, 255, 0.07);
  --card-hover-border: rgba(37, 99, 235, 0.4);
  
  --primary: #2563eb;
  --primary-light: #60a5fa;
  --primary-dark: #1d4ed8;
  --primary-gradient: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  
  --accent-green: #10b981;
  --accent-red: #ef4444;
  --accent-orange: #f59e0b;
  
  /* Typography Colors */
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dark: #64748b;
  
  /* Fonts */
  --font-family-title: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-family-body: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  
  /* Layout and Effects */
  --sidebar-width: 280px;
  --nav-height-mobile: 70px;
  --border-radius-lg: 20px;
  --border-radius-md: 12px;
  --border-radius-sm: 8px;
  --box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  --glow-shadow: 0 0 20px rgba(37, 99, 235, 0.2);
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --backdrop-blur: blur(16px);
}

/* ==========================================================================
   BASE RESET
   ========================================================================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background-color: var(--bg-color);
  background-image: var(--bg-gradient);
  background-attachment: fixed;
  color: var(--text-main);
  font-family: var(--font-family-body);
  font-size: 16px;
  line-height: 1.5;
  overflow-x: hidden;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-family-title);
  font-weight: 700;
  letter-spacing: -0.02em;
}

a {
  text-decoration: none;
  color: inherit;
}

ul {
  list-style: none;
}

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  background: none;
  border: none;
  color: inherit;
  outline: none;
}

.hidden {
  display: none !important;
}

/* ==========================================================================
   BUTTONS & FORM CONTROLS
   ========================================================================== */
.btn-primary {
  background: var(--primary-gradient);
  color: white;
  padding: 12px 24px;
  border-radius: var(--border-radius-md);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(37, 99, 235, 0.3);
  transition: var(--transition);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

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

.btn-primary:active {
  transform: translateY(0);
}

.btn-large {
  padding: 16px 32px;
  font-size: 1.1rem;
  border-radius: var(--border-radius-lg);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-main);
  padding: 12px 24px;
  border-radius: var(--border-radius-md);
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  transition: var(--transition);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: translateY(-2px);
}

.btn-danger {
  background: var(--accent-red);
  color: white;
  padding: 12px 24px;
  border-radius: var(--border-radius-md);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  transition: var(--transition);
}

.btn-danger:hover {
  background: #dc2626;
  transform: translateY(-2px);
}

.btn-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}

.btn-icon:hover {
  background: rgba(255, 255, 255, 0.15);
  color: var(--primary-light);
  transform: scale(1.05);
}

.btn-round {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.full-width {
  width: 100%;
}

/* Form inputs */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 8px;
  font-weight: 500;
}

.input-wrapper {
  position: relative;
  width: 100%;
}

.input-wrapper input {
  padding-left: 45px;
}

input[type="text"],
input[type="password"],
select {
  width: 100%;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--border-radius-md);
  color: white;
  transition: var(--transition);
}

input[type="text"]:focus,
input[type="password"]:focus,
select:focus {
  border-color: var(--primary);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 10px rgba(37, 99, 235, 0.15);
}

.input-icon {
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dark);
  width: 20px;
  height: 20px;
  pointer-events: none;
}

/* ==========================================================================
   LOADING & EMPTY STATE
   ========================================================================== */
.loading-screen {
  position: fixed;
  inset: 0;
  background: var(--bg-color);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.loader {
  width: 48px;
  height: 48px;
  border: 5px solid rgba(255, 255, 255, 0.1);
  border-bottom-color: var(--primary);
  border-radius: 50%;
  animation: rotation 1s linear infinite;
}

@keyframes rotation {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.empty-state {
  text-align: center;
  padding: 60px 20px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--border-radius-lg);
  backdrop-filter: var(--backdrop-blur);
  margin-top: 30px;
}

.empty-state i {
  width: 64px;
  height: 64px;
  color: var(--text-dark);
  margin-bottom: 20px;
}

.empty-state h3 {
  font-size: 1.4rem;
  margin-bottom: 10px;
}

.empty-state p {
  color: var(--text-muted);
}

/* ==========================================================================
   LOGIN PAGE
   ========================================================================== */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.login-card {
  width: 100%;
  max-width: 450px;
  background: var(--card-bg);
  backdrop-filter: var(--backdrop-blur);
  border: 1px solid var(--card-border);
  border-radius: var(--border-radius-lg);
  padding: 40px;
  box-shadow: var(--box-shadow);
  animation: slideUp 0.5s ease-out;
}

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

.login-header {
  text-align: center;
  margin-bottom: 35px;
}

.login-logo {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: rgba(37, 99, 235, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  border: 1px solid rgba(37, 99, 235, 0.3);
}

.logo-icon {
  color: var(--primary-light);
  width: 32px;
  height: 32px;
}

.login-header h1 {
  font-size: 2.2rem;
  margin-bottom: 8px;
}

.login-header p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.login-error {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  padding: 12px;
  border-radius: var(--border-radius-md);
  color: #fca5a5;
  font-size: 0.9rem;
  margin-bottom: 20px;
}

.error-icon {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
}

.demo-info {
  margin-top: 25px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--border-radius-sm);
  font-size: 0.85rem;
  text-align: center;
  color: var(--text-muted);
  border: 1px dashed rgba(255, 255, 255, 0.1);
}

/* ==========================================================================
   APP SHELL LAYOUT
   ========================================================================== */
.app-shell {
  display: flex;
  min-height: 100vh;
}

/* Navigation - Sidebar on Desktop */
.app-navigation {
  width: var(--sidebar-width);
  background: rgba(10, 12, 20, 0.8);
  border-right: 1px solid var(--card-border);
  backdrop-filter: var(--backdrop-blur);
  padding: 30px 20px;
  display: flex;
  flex-direction: column;
  position: fixed;
  height: 100vh;
  z-index: 100;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 40px;
  padding-left: 10px;
}

.brand-icon {
  color: var(--accent-red);
  width: 28px;
  height: 28px;
  filter: drop-shadow(0 0 8px rgba(239, 68, 68, 0.4));
}

.brand-text {
  font-family: var(--font-family-title);
  font-size: 1.4rem;
  font-weight: 800;
  background: linear-gradient(135deg, #ffffff 0%, #cbd5e1 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.nav-menu {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 14px 18px;
  border-radius: var(--border-radius-md);
  color: var(--text-muted);
  font-weight: 500;
  transition: var(--transition);
}

.nav-link i {
  width: 22px;
  height: 22px;
}

.nav-link:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
  transform: translateX(3px);
}

.nav-link.active {
  background: rgba(37, 99, 235, 0.15);
  color: var(--primary-light);
  font-weight: 600;
  border-left: 4px solid var(--primary);
  border-radius: 4px var(--border-radius-md) var(--border-radius-md) 4px;
}

.nav-user {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 15px 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.user-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--primary-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.1rem;
  color: white;
  box-shadow: 0 4px 10px rgba(37, 99, 235, 0.3);
}

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

.user-name {
  display: block;
  font-weight: 600;
  font-size: 0.95rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-role {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.logout-btn {
  color: var(--text-dark);
  cursor: pointer;
  transition: var(--transition);
  padding: 5px;
}

.logout-btn:hover {
  color: var(--accent-red);
  transform: scale(1.1);
}

/* Main Content Area */
.app-main {
  flex: 1;
  margin-left: var(--sidebar-width);
  padding: 40px;
  min-height: 100vh;
}

.app-page {
  animation: fadeIn 0.4s ease-out;
  max-width: 1200px;
  margin: 0 auto;
}

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

.page-header {
  margin-bottom: 35px;
  display: flex;
  align-items: center;
}

.justify-between {
  justify-content: space-between;
}

.page-header h1 {
  font-size: 2.4rem;
  margin-bottom: 5px;
}

.page-header .subtitle {
  color: var(--text-muted);
  font-size: 1.05rem;
}

/* Cards */
.card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--border-radius-lg);
  backdrop-filter: var(--backdrop-blur);
  padding: 24px;
  box-shadow: var(--box-shadow);
  transition: var(--transition);
}

.card:hover {
  border-color: var(--card-hover-border);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 15px;
}

.header-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-title i {
  color: var(--primary-light);
  width: 24px;
  height: 24px;
}

.header-title h2 {
  font-size: 1.35rem;
  font-weight: 600;
}

/* ==========================================================================
   DASHBOARD / HOME PAGE
   ========================================================================== */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 30px;
}

/* Status widget list */
.status-list {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.status-item {
  display: flex;
  align-items: flex-start;
  gap: 15px;
  padding: 15px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--border-radius-md);
  border: 1px solid rgba(255, 255, 255, 0.05);
  transition: var(--transition);
}

.status-item:hover {
  background: rgba(255, 255, 255, 0.05);
}

.status-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(37, 99, 235, 0.1);
  border: 1px solid rgba(37, 99, 235, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: var(--primary-light);
  flex-shrink: 0;
}

.status-content {
  flex: 1;
}

.status-author {
  font-weight: 600;
  font-size: 0.95rem;
  margin-right: 8px;
}

.status-time {
  font-size: 0.75rem;
  color: var(--text-dark);
}

.status-text {
  margin-top: 5px;
  color: var(--text-main);
  font-size: 1rem;
}

/* Recent news / activity */
.recent-activity {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.activity-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.1) 0%, rgba(29, 78, 216, 0.05) 100%);
  border-radius: var(--border-radius-md);
  border: 1px solid rgba(37, 99, 235, 0.2);
}

.stat-num {
  font-family: var(--font-family-title);
  font-size: 3rem;
  font-weight: 800;
  line-height: 1;
  color: var(--primary-light);
  margin-bottom: 5px;
  text-shadow: 0 0 10px rgba(37, 99, 235, 0.3);
}

.stat-label {
  font-size: 0.9rem;
  color: var(--text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.activity-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.activity-item {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.9rem;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.activity-item:last-child {
  border-bottom: none;
}

.activity-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary-light);
  flex-shrink: 0;
}

.activity-details {
  flex: 1;
}

.activity-desc {
  color: var(--text-muted);
}

.activity-desc strong {
  color: var(--text-main);
}

.activity-date {
  font-size: 0.75rem;
  color: var(--text-dark);
  display: block;
  margin-top: 2px;
}

/* ==========================================================================
   PHOTO CLOUD PAGE
   ========================================================================== */
.photo-actions {
  display: flex;
  align-items: center;
  gap: 15px;
}

.photo-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 30px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  padding: 15px 20px;
  border-radius: var(--border-radius-md);
}

.search-bar {
  position: relative;
  flex: 1;
  max-width: 400px;
}

.search-bar i {
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dark);
  width: 18px;
  height: 18px;
}

.search-bar input {
  padding-left: 45px;
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.filter-group label {
  color: var(--text-muted);
  font-size: 0.9rem;
  white-space: nowrap;
}

.filter-group select {
  width: auto;
  min-width: 150px;
  cursor: pointer;
}

/* Masonry Photos Grid */
.photos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  grid-gap: 25px;
  grid-auto-rows: 240px;
}

.photo-card {
  position: relative;
  border-radius: var(--border-radius-md);
  overflow: hidden;
  cursor: pointer;
  border: 1px solid var(--card-border);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
  transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.photo-card:hover {
  transform: scale(1.03);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.6), var(--glow-shadow);
  border-color: var(--primary-light);
}

.photo-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: all 0.6s ease;
}

.photo-card:hover img {
  transform: scale(1.05);
}

.photo-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(8, 9, 12, 0.95) 0%, rgba(8, 9, 12, 0.4) 60%, transparent 100%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 20px;
  opacity: 0;
  transition: var(--transition);
}

.photo-card:hover .photo-overlay {
  opacity: 1;
}

.photo-caption {
  font-weight: 600;
  font-size: 1rem;
  color: white;
  margin-bottom: 5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.photo-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.photo-uploader {
  font-weight: 500;
  color: var(--primary-light);
}

/* Upload Progress Card */
.upload-progress-card {
  background: rgba(37, 99, 235, 0.1);
  border: 1px solid rgba(37, 99, 235, 0.25);
  border-radius: var(--border-radius-md);
  padding: 15px 20px;
  margin-bottom: 25px;
  animation: slideDown 0.3s ease-out;
}

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

.progress-info {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 0.9rem;
  font-weight: 500;
}

.progress-track {
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--primary-gradient);
  border-radius: 3px;
  transition: width 0.2s ease-out;
}

/* ==========================================================================
   FAMILY CHAT PAGE
   ========================================================================== */
.chat-container {
  height: calc(100vh - 120px);
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--border-radius-lg);
  backdrop-filter: var(--backdrop-blur);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--box-shadow);
}

.chat-header {
  padding: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.01);
}

.chat-title-info {
  display: flex;
  align-items: center;
  gap: 15px;
}

.chat-title-info .header-icon {
  width: 28px;
  height: 28px;
  color: var(--primary-light);
}

.chat-title-info h2 {
  font-size: 1.4rem;
}

.chat-messages {
  flex: 1;
  padding: 25px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.chat-bubble-wrapper {
  display: flex;
  flex-direction: column;
  max-width: 75%;
}

.chat-bubble-wrapper.incoming {
  align-self: flex-start;
  align-items: flex-start;
}

.chat-bubble-wrapper.outgoing {
  align-self: flex-end;
  align-items: flex-end;
}

.chat-bubble-meta {
  font-size: 0.75rem;
  color: var(--text-dark);
  margin-bottom: 5px;
  display: flex;
  gap: 10px;
}

.chat-sender-name {
  font-weight: 600;
  color: var(--text-muted);
}

.chat-bubble-wrapper.outgoing .chat-sender-name {
  color: var(--primary-light);
}

.chat-bubble {
  padding: 14px 18px;
  border-radius: var(--border-radius-lg);
  font-size: 1rem;
  line-height: 1.4;
  word-break: break-word;
  position: relative;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.incoming .chat-bubble {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-main);
  border-top-left-radius: 4px;
}

.outgoing .chat-bubble {
  background: var(--primary-gradient);
  color: white;
  border-top-right-radius: 4px;
}

.chat-input-area {
  padding: 20px;
  background: rgba(8, 9, 12, 0.5);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  gap: 15px;
  align-items: center;
}

.chat-input-area input {
  flex: 1;
  height: 48px;
  border-radius: 24px;
  padding: 0 25px;
}

/* ==========================================================================
   ADMIN PANEL PAGE
   ========================================================================== */
.admin-grid {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 30px;
  align-items: start;
}

.form-error {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.25);
  color: #fca5a5;
  padding: 10px;
  border-radius: var(--border-radius-md);
  font-size: 0.85rem;
  margin-bottom: 15px;
}

.form-success {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.25);
  color: #a7f3d0;
  padding: 10px;
  border-radius: var(--border-radius-md);
  font-size: 0.85rem;
  margin-bottom: 15px;
}

/* Tables for member list */
.table-container {
  overflow-x: auto;
}

.user-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.user-table th,
.user-table td {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.user-table th {
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.9rem;
}

.user-table td {
  font-size: 0.95rem;
}

.role-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.role-badge.admin {
  background: rgba(37, 99, 235, 0.15);
  color: var(--primary-light);
  border: 1px solid rgba(37, 99, 235, 0.3);
}

.role-badge.member {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-delete-user {
  color: var(--text-dark);
  cursor: pointer;
  transition: var(--transition);
}

.btn-delete-user:hover:not(:disabled) {
  color: var(--accent-red);
}

.btn-delete-user:disabled {
  opacity: 0.25;
  cursor: not-allowed;
}

/* ==========================================================================
   MODALS & LIGHTBOX (PHOTO VIEWER)
   ========================================================================== */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(5, 5, 8, 0.95);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  backdrop-filter: blur(10px);
  animation: fadeIn 0.3s ease-out;
}

.lightbox-close {
  position: absolute;
  top: 30px;
  right: 40px;
  font-size: 3rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
  z-index: 1010;
}

.lightbox-close:hover {
  color: white;
  transform: scale(1.1);
}

.lightbox-content {
  display: flex;
  flex-direction: column;
  max-width: 90%;
  max-height: 90%;
  align-items: center;
  justify-content: center;
}

.lightbox-content img {
  max-width: 100%;
  max-height: 70vh;
  object-fit: contain;
  border-radius: var(--border-radius-md);
  box-shadow: 0 10px 40px rgba(0,0,0,0.8);
}

.lightbox-meta {
  width: 100%;
  max-width: 800px;
  margin-top: 25px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 30px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  padding: 20px;
  border-radius: var(--border-radius-md);
}

.lightbox-caption {
  font-size: 1.2rem;
  font-weight: 600;
  color: white;
  margin-bottom: 5px;
}

.lightbox-details {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.lightbox-details strong {
  color: var(--primary-light);
}

.meta-right {
  display: flex;
  gap: 15px;
}

/* Modals */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  backdrop-filter: blur(5px);
  animation: fadeIn 0.2s ease-out;
}

.modal-card {
  width: 100%;
  max-width: 500px;
  background: #121621;
  border: 1px solid var(--card-border);
  border-radius: var(--border-radius-lg);
  padding: 30px;
  box-shadow: var(--box-shadow);
  position: relative;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 25px;
}

.modal-close {
  font-size: 2rem;
  color: var(--text-dark);
  cursor: pointer;
  transition: var(--transition);
}

.modal-close:hover {
  color: white;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 15px;
  margin-top: 25px;
}

/* ==========================================================================
   RESPONSIVE LAYOUTS (MOBILE FIRST / MEDIA QUERIES)
   ========================================================================== */

/* Tablet & Mobile Layouts (Screens smaller than 900px) */
@media (max-width: 900px) {
  /* Restructure main layout: Sidebar hides, layout changes from row to column */
  .app-shell {
    flex-direction: column;
  }
  
  .app-navigation {
    width: 100%;
    height: var(--nav-height-mobile);
    flex-direction: row;
    position: fixed;
    bottom: 0;
    top: auto;
    left: 0;
    padding: 0 15px;
    border-right: none;
    border-top: 1px solid var(--card-border);
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 -10px 30px rgba(0,0,0,0.5);
  }
  
  .nav-brand {
    display: none; /* Hide brand name in bottom bar */
  }
  
  .nav-menu {
    flex-direction: row;
    width: 100%;
    justify-content: space-around;
    align-items: center;
    height: 100%;
    margin-bottom: 0;
  }
  
  .nav-item {
    flex: 1;
    display: flex;
    justify-content: center;
  }
  
  .nav-link {
    flex-direction: column;
    gap: 4px;
    padding: 8px 10px;
    font-size: 0.75rem;
    align-items: center;
    border-left: none !important;
    border-radius: var(--border-radius-md);
  }
  
  .nav-link.active {
    background: rgba(37, 99, 235, 0.12);
    border-bottom: 3px solid var(--primary);
    border-radius: var(--border-radius-md);
  }
  
  .nav-link i {
    width: 20px;
    height: 20px;
  }
  
  .link-text {
    font-size: 0.7rem;
    font-weight: 500;
  }
  
  .nav-user {
    display: none; /* Hide user section on mobile bottom bar */
  }
  
  .app-main {
    margin-left: 0;
    padding: 20px 20px calc(var(--nav-height-mobile) + 20px);
  }
  
  .page-header h1 {
    font-size: 1.8rem;
  }
  
  /* Dashboard layout */
  .dashboard-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  
  /* Admin layout */
  .admin-grid {
    grid-template-columns: 1fr;
    gap: 25px;
  }
  
  /* Photos grid resize */
  .photos-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    grid-auto-rows: 150px;
    grid-gap: 15px;
  }
  
  .photo-card {
    border-radius: var(--border-radius-sm);
  }
  
  .photo-overlay {
    padding: 10px;
  }
  
  .photo-caption {
    font-size: 0.85rem;
  }
  
  .photo-meta {
    font-size: 0.7rem;
  }
  
  /* Lightbox meta column shift */
  .lightbox {
    padding: 15px;
  }
  
  .lightbox-close {
    top: 15px;
    right: 20px;
    font-size: 2.5rem;
  }
  
  .lightbox-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 15px;
    padding: 15px;
  }
  
  .meta-right {
    width: 100%;
    justify-content: space-between;
  }
  
  .meta-right .btn-secondary,
  .meta-right .btn-danger {
    flex: 1;
    padding: 10px;
    font-size: 0.85rem;
  }
  
  /* Chat window size */
  .chat-container {
    height: calc(100vh - var(--nav-height-mobile) - 50px);
  }
}

/* Very Small Devices */
@media (max-width: 480px) {
  .page-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 15px;
  }
  
  .photo-actions {
    width: 100%;
  }
  
  .photo-actions button {
    width: 100%;
  }
  
  .photo-controls {
    flex-direction: column;
    align-items: stretch;
    padding: 12px;
  }
  
  .filter-group {
    justify-content: space-between;
  }
  
  .chat-messages {
    padding: 15px;
  }
  
  .chat-bubble-wrapper {
    max-width: 90%;
  }
  
  .chat-input-area {
    padding: 10px;
    gap: 10px;
  }
  
  .chat-input-area input {
    height: 42px;
    padding: 0 15px;
  }
}
