body {
  font-family: Arial, sans-serif;
  margin: 0;
  background-color: var(--primary-color);
  color: var(--text-color);
  transition: background-color 0.3s, color 0.3s;
  height: 100vh;
}

/* Dark Theme Base Styles */
[data-theme="dark"] {
  color: #ffffff;
}

[data-theme="dark"] h1,
[data-theme="dark"] h2,
[data-theme="dark"] h3,
[data-theme="dark"] h4,
[data-theme="dark"] h5,
[data-theme="dark"] h6,
[data-theme="dark"] p,
[data-theme="dark"] span,
[data-theme="dark"] div,
[data-theme="dark"] label,
[data-theme="dark"] td,
[data-theme="dark"] th {
  color: #ffffff;
}

[data-theme="dark"] input,
[data-theme="dark"] textarea,
[data-theme="dark"] select {
  color: #ffffff;
  background-color: #1f2937;
  border-color: #374151;
}

[data-theme="dark"] input::placeholder,
[data-theme="dark"] textarea::placeholder {
  color: #9ca3af;
}

[data-theme="dark"] a {
  color: #60a5fa;
}

/*** Remove inconsistent (among browsers) -
	 *** default padding or margin
	 ***/
ul, li, h1, h2, h3, h4, h5, h6, pre, form, body, html, p, blockquote, fieldset,
  input, label, div, dd, dt, dl, table, tr, td, img, hr {
  margin: 0px;
  padding: 0px;
}

.container {
  max-width: 800px;
  margin: 0 auto;
}

.card {
  background-color: var(--secondary-color);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 20px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.button {
  background-color: var(--accent-color);
  color: #ffffff;
  padding: 8px 16px;
  border-radius: 4px;
  border: none;
  cursor: pointer;
}

input, textarea, select {
  background-color: var(--input-color);
  color: var(--text-color);
  border: 1px solid var(--border-color);
  padding: 8px;
  border-radius: 4px;
  width: 100%;
  margin-bottom: 10px;
  box-sizing: border-box;
}

.error-message {
  color: #f00;
}

/* Notification button with badge */
.notification-btn {
    position: relative;
    background: none;
    border: none;
    color: var(--text-color);
    font-size: 20px;
    cursor: pointer;
    padding: 8px;
    transition: opacity 0.2s;
}

.notification-btn:hover {
    opacity: 0.8;
}

/* Manage button (settings/admin) */
.manage-btn {
    position: relative;
    background: none;
    border: none;
    color: var(--text-color);
    font-size: 20px;
    cursor: pointer;
    padding: 8px;
    transition: all 0.2s;
}

.manage-btn:hover {
    opacity: 0.8;
    transform: rotate(90deg);
}

/* Notification badge */
.notification-badge {
    position: absolute;
    top: 0;
    right: 0;
    background-color: #ff0000;
    color: #ffffff;
    border-radius: 50%;
    padding: 2px 2px;
    font-size: 11px;
    font-weight: bold;
    min-width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transform: translate(25%, -25%);
}

/* Hide badge when count is 0 */
.notification-badge[data-count="0"],
.notification-badge:empty {
    display: none;
}

/* Adjust badge for larger numbers */
.notification-badge.large-count {
    border-radius: 10px;
    padding: 2px 5px;
    min-width: 24px;
}

/* Notification Dropdown Styles */
.notification-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 10px;
    width: 380px;
    background: var(--card-bg, #1a2332);
    border: 1px solid var(--border-color, #2a3441);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    max-height: 80vh; /* Limit dropdown height */
}

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

/* Dropdown arrow */
.notification-dropdown::before {
    content: '';
    position: absolute;
    top: -8px;
    right: 118px;
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-bottom: 8px solid var(--border-color, #2a3441);
}

.notification-dropdown::after {
    content: '';
    position: absolute;
    top: -7px;
    right: 118px;
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-bottom: 8px solid var(--card-bg, #1a2332);
}

/* Dropdown header */
.notification-dropdown-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid var(--border-color, #2a3441);
    flex-shrink: 0; /* Prevent header from shrinking */
}

.notification-dropdown-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: white;
}

.mark-all-read-btn {
    background: none;
    border: none;
    color: var(--primary-color, #007bff);
    font-size: 13px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s;
}

.mark-all-read-btn:hover {
    background: rgba(0, 123, 255, 0.1);
}

/* Dropdown content - Updated scrollable area */
.notification-dropdown-content {
    flex: 1; /* Take remaining space */
    overflow-y: auto; /* Enable vertical scrolling */
    overscroll-behavior: contain; /* Prevent scroll chaining */
}

/* Custom scrollbar styling */
.notification-dropdown-content::-webkit-scrollbar {
    width: 6px;
}

.notification-dropdown-content::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
}

.notification-dropdown-content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

.notification-dropdown-content::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Notification items */
.notification-dropdown-item {
    display: flex;
    align-items: flex-start;
    padding: 15px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: background 0.2s;
    cursor: pointer;
}

.notification-dropdown-item:hover {
    background: rgba(255, 255, 255, 0.02);
}

.notification-content {
    flex: 1;
    margin-right: 10px;
}

.notification-text {
    font-size: 14px;
    color: white;
    margin-bottom: 5px;
    line-height: 1.4;
}

.notification-time {
    font-size: 12px;
    color: var(--text-secondary, #8892b0);
}

.notification-mark-read {
    background: none;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.notification-mark-read:hover {
    background: var(--primary-color, #007bff);
    color: white;
    border-color: var(--primary-color, #007bff);
}

.notification-mark-read i {
    font-size: 12px;
}

/* No notifications */
.no-notifications {
    padding: 40px 20px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 14px;
}

.notification-loader {
    padding: 40px 20px;
    text-align: center;
    color: var(--text-secondary);
}

/* More notifications indicator */
.more-notifications {
    padding: 10px 20px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 13px;
    background: rgba(255, 255, 255, 0.02);
    cursor: pointer;
}

.more-notifications:hover {
    background: rgba(255, 255, 255, 0.05);
}

/* Dropdown footer */
.notification-dropdown-footer {
    padding: 12px 20px;
    border-top: 1px solid var(--border-color, #2a3441);
    text-align: center;
    flex-shrink: 0; /* Prevent footer from shrinking */
}

.notification-dropdown-footer a {
    color: white;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
}

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

/* Mobile responsive */
@media (max-width: 480px) {
    .notification-dropdown {
        width: calc(100vw - 20px);
        right: -10px;
        max-height: 70vh; /* Slightly smaller max-height on mobile */
    }
}

/* ========================================
   DESKTOP STYLES - Hide mobile elements
   ======================================== */

/* Hide mobile-only elements on desktop */
.hamburger-menu {
	display: none;
}

.mobile-nav-overlay {
	display: none;
}

.sidebar-close {
	display: none;
}

/* Hide mobile navigation items on desktop sidebar */
.nav-separator.mobile-only,
.nav-theme.mobile-only,
.nav-profile,
.nav-logout {
	display: none !important;
}

/* Ensure desktop elements are visible */
@media (min-width: 768px) {
	/* Show desktop header controls */
	#theme-toggle,
	.profile-btn,
	.logout-btn,
	.manage-btn {
		display: inline-flex !important;
	}
	
	/* Logo on desktop - normal positioning */
	.logo-small {
		display: flex !important;
		position: static;
		transform: none;
		left: auto;
	}
	
	.logo-small img {
		height: 35px;
	}
	
	/* Keep mobile nav items hidden on desktop */
	.nav-separator.mobile-only,
	.nav-theme.mobile-only,
	.nav-profile,
	.nav-logout {
		display: none !important;
	}
}

/* ========================================
   MOBILE INTERFACE FIXES
   ======================================== */

/* Mobile Navigation Fixes */
@media (max-width: 767px) {
	/* Fix hamburger button positioning and styling */
	.hamburger-menu {
		position: fixed;
		top: 12px;
		left: 10px;
		z-index: 1002;
		background: rgba(255, 255, 255, 0.1);
		border: 1px solid rgba(255, 255, 255, 0.2);
		border-radius: 6px;
		cursor: pointer;
		padding: 8px;
		width: 40px;
		height: 40px;
		display: flex;
		flex-direction: column;
		justify-content: center;
		align-items: center;
		gap: 3px;
		transition: all 0.3s ease;
	}

	.hamburger-menu:hover {
		background: rgba(255, 255, 255, 0.15);
	}

	.hamburger-menu span {
		display: block;
		width: 22px;
		height: 2px;
		background-color: #ffffff;
		border-radius: 2px;
		transition: all 0.3s ease;
	}

	/* Animated X when active */
	.hamburger-menu.active span:nth-child(1) {
		transform: rotate(45deg) translate(5px, 5px);
	}

	.hamburger-menu.active span:nth-child(2) {
		opacity: 0;
		transform: scale(0);
	}

	.hamburger-menu.active span:nth-child(3) {
		transform: rotate(-45deg) translate(5px, -5px);
	}

	/* Top bar adjustments */
	.top-bar {
		padding-left: 60px;
		padding-right: 15px;
		height: 56px;
		position: fixed;
		top: 0;
		left: 0;
		right: 0;
		z-index: 999;
		background-color: #1a2332;
		box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
		display: flex;
		align-items: center;
		justify-content: space-between;
	}

	/* Logo adjustments - show on mobile but centered */
	.logo-small {
		display: flex !important;
		align-items: center;
		position: absolute;
		left: 50%;
		transform: translateX(-50%);
	}

	.logo-small img {
		height: 30px;
		width: auto;
	}

	/* Header controls - position at the right */
	.header-controls {
		display: flex;
		align-items: center;
		gap: 8px;
		margin-left: auto; /* Push to the right */
		position: relative;
		z-index: 1;
	}

	/* Hide theme toggle, profile, and logout buttons on mobile */
	#theme-toggle,
	.profile-btn,
	.logout-btn {
		display: none !important;
	}

	/* Notification button styling - ensure it's visible on the right */
	.notification-btn {
		display: flex !important;
		align-items: center;
		justify-content: center;
		width: 40px;
		height: 40px;
		background: rgba(255, 255, 255, 0.1);
		border-radius: 6px;
		border: 1px solid rgba(255, 255, 255, 0.1);
		transition: all 0.2s ease;
		position: relative;
	}



	.notification-btn:hover,
	.notification-btn:active {
		background: rgba(255, 255, 255, 0.15);
	}

	.notification-btn i {
		font-size: 18px;
		color: #ffffff;
	}

	/* Notification badge positioning */
	.notification-badge {
		position: absolute;
		top: -2px;
		right: -2px;
		transform: none;
	}

	/* Sidebar styling */
	.sidebar-container {
		position: fixed;
		top: 0;
		left: -100%;
		width: 75%;
		max-width: 280px;
		height: 100vh;
		background-color: #15283E;
		z-index: 1001;
		transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
		overflow-y: auto;
		overflow-x: hidden;
		box-shadow: 2px 0 15px rgba(0, 0, 0, 0.3);
	}

	/* Sidebar when active */
	.sidebar-container.mobile-active {
		left: 0;
	}

	/* Sidebar header with close button */
	.sidebar-container::before {
		content: '';
		display: block;
		height: 56px;
		background: #0f1f2e;
		border-bottom: 1px solid rgba(255, 255, 255, 0.1);
		margin-bottom: 10px;
	}

	/* Close button in sidebar */
	.sidebar-close {
		position: absolute;
		top: 12px;
		right: 12px;
		width: 32px;
		height: 32px;
		background: rgba(255, 255, 255, 0.1);
		border: 1px solid rgba(255, 255, 255, 0.2);
		border-radius: 50%;
		display: flex;
		align-items: center;
		justify-content: center;
		cursor: pointer;
		z-index: 1002;
		transition: all 0.2s ease;
	}

	.sidebar-close:hover {
		background: rgba(255, 255, 255, 0.2);
		transform: rotate(90deg);
	}

	.sidebar-close::before,
	.sidebar-close::after {
		content: '';
		position: absolute;
		width: 16px;
		height: 2px;
		background: #ffffff;
		border-radius: 1px;
	}

	.sidebar-close::before {
		transform: rotate(45deg);
	}

	.sidebar-close::after {
		transform: rotate(-45deg);
	}

	/* Navigation menu styling */
	.sidebar-container nav,
	.sidebar-container .navigation {
		padding: 10px 0;
		margin: 0;
	}

	.sidebar-container nav ul,
	.sidebar-container .navigation ul {
		list-style: none;
		padding: 0;
		margin: 0;
	}

	.sidebar-container nav li,
	.sidebar-container .navigation li {
		margin: 0;
		border: none;
	}

	.sidebar-container nav a,
	.sidebar-container .navigation a {
		display: flex;
		align-items: center;
		padding: 14px 20px;
		color: #ffffff;
		text-decoration: none;
		font-size: 15px;
		transition: all 0.2s ease;
		position: relative;
	}

	.sidebar-container nav a:hover,
	.sidebar-container .navigation a:hover {
		background-color: rgba(255, 255, 255, 0.08);
	}

	/* Icons in navigation */
	.sidebar-container nav a i,
	.sidebar-container .navigation a i {
		margin-right: 12px;
		width: 20px;
		text-align: center;
		font-size: 16px;
	}

	/* Mobile-only navigation items - only show on mobile */
	.nav-separator.mobile-only {
		display: block !important;
		height: 1px !important;
		background: rgba(255, 255, 255, 0.1) !important;
		margin: 15px 20px !important;
		padding: 0 !important;
	}

	.nav-theme.mobile-only,
	.nav-profile,
	.nav-logout {
		display: block !important;
	}

	.nav-theme {
		margin-top: auto;
		border-top: 1px solid rgba(255, 255, 255, 0.1);
		padding-top: 10px;
	}

	.nav-profile,
	.nav-logout {
		border-top: none;
	}

	.nav-logout a {
		color: #ff6b6b !important;
	}

	.nav-logout a:hover {
		background-color: rgba(255, 107, 107, 0.1) !important;
	}

	/* Mobile overlay */
	.mobile-nav-overlay {
		display: block;
		position: fixed;
		top: 0;
		left: 0;
		width: 100%;
		height: 100%;
		background-color: rgba(0, 0, 0, 0.5);
		z-index: 1000;
		opacity: 0;
		visibility: hidden;
		transition: opacity 0.3s ease, visibility 0.3s ease;
		backdrop-filter: blur(2px);
	}

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

	/* Main content adjustments */
	.dashboard-container {
		margin-top: 56px;
		padding: 0;
		min-height: calc(100vh - 56px);
	}

	.main-content {
		width: 100%;
		padding: 15px;
		box-sizing: border-box;
		margin-left: 0;
	}

	/* Content header */
	.content-header {
		padding: 0 0 15px 0;
		margin-bottom: 15px;
		border-bottom: 1px solid rgba(255, 255, 255, 0.1);
	}

	.content-header h1,
	#content-page-title {
		font-size: 22px;
		margin: 0;
		/* color: #ffffff; */
		font-weight: 600;
	}

	/* Content area */
	#content-page {
		padding: 0;
		background: transparent;
	}

	/* Table responsiveness */
	table {
		width: 100%;
		display: block;
		overflow-x: auto;
		-webkit-overflow-scrolling: touch;
		background: rgba(255, 255, 255, 0.02);
		border-radius: 8px;
		padding: 10px;
	}

	table thead {
		display: none;
	}

	table tbody tr {
		display: block;
		margin-bottom: 15px;
		background: rgba(255, 255, 255, 0.05);
		border-radius: 6px;
		padding: 12px;
	}

	table tbody td {
		display: block;
		text-align: left;
		padding: 6px 0;
		border: none;
		position: relative;
		padding-left: 40%;
	}

	table tbody td::before {
		content: attr(data-label);
		position: absolute;
		left: 0;
		width: 35%;
		padding-right: 10px;
		font-weight: bold;
		color: rgba(255, 255, 255, 0.6);
	}

	/* Cards for mobile */
	.card {
		padding: 15px;
		margin-bottom: 12px;
		background: rgba(255, 255, 255, 0.03);
		border: 1px solid rgba(255, 255, 255, 0.1);
		border-radius: 8px;
	}

	/* Buttons */
	.button,
	button[type="submit"] {
		width: 100%;
		padding: 12px 20px;
		font-size: 15px;
		border-radius: 6px;
		margin-bottom: 10px;
		font-weight: 500;
	}

	/* Form elements */
	input,
	textarea,
	select {
		width: 100%;
		padding: 12px;
		font-size: 16px;
		border-radius: 6px;
		background: rgba(255, 255, 255, 0.05);
		border: 1px solid rgba(255, 255, 255, 0.1);
		/* color: #ffffff; */
	}

	input:focus,
	textarea:focus,
	select:focus {
		outline: none;
		border-color: #007bff;
		background: rgba(255, 255, 255, 0.08);
	}

	/* Notification dropdown mobile adjustments */
	.notification-dropdown {
		position: fixed;
		top: 56px;
		left: 10px;
		right: 10px;
		width: auto;
		max-height: calc(100vh - 76px);
		border-radius: 8px;
	}

	.notification-dropdown::before,
	.notification-dropdown::after {
		display: none;
	}

	/* Hide horizontal scrollbar but keep functionality */
	::-webkit-scrollbar {
		height: 3px;
	}

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

	::-webkit-scrollbar-thumb {
		background: rgba(255, 255, 255, 0.2);
		border-radius: 2px;
	}

	/* Prevent body scroll when menu is open */
	body.menu-open {
		overflow: hidden;
		position: fixed;
		width: 100%;
	}
}

/* Small mobile devices - 480px and below */
@media (max-width: 480px) {
	.sidebar-container {
		width: 85%;
	}

	.main-content {
		padding: 12px;
	}

	.content-header h1,
	#content-page-title {
		font-size: 20px;
	}

	table tbody td {
		padding-left: 0;
		padding-top: 20px;
	}

	table tbody td::before {
		position: static;
		display: block;
		width: 100%;
		padding-bottom: 4px;
		font-size: 12px;
	}
}

/* Landscape orientation adjustments */
@media (max-width: 767px) and (orientation: landscape) {
	.top-bar {
		height: 48px;
	}

	.dashboard-container {
		margin-top: 48px;
	}

	.sidebar-container::before {
		height: 48px;
	}

	.notification-dropdown {
		top: 48px;
		max-height: calc(100vh - 58px);
	}
}

/* ========================================
   UNIVERSAL RESPONSIVE TABLE STYLES
   Applies to all tables in the Atlas system
   ======================================== */

/* Mobile color variables for easy customization */
:root {
    /* Mobile card backgrounds */
    --card-bg-mobile: #253444;           /* Main card background - lighter */
    --card-bg-mobile-alt: #2a3a4d;       /* Alternating card background */
    --label-color-mobile: #94a3b8;       /* Label text color */
    --text-color-mobile: #e2e8f0;        /* Content text color - brighter */
    --badge-color: #3b82f6;              /* ID badge color */
    --border-color-mobile: #354456;      /* Card border color */
    --action-border-mobile: rgba(255, 255, 255, 0.1); /* Action section border */
}

/* Dark theme adjustments */
[data-theme="dark"], body.dark-theme {
    --card-bg-mobile: #253444;
    --card-bg-mobile-alt: #2a3a4d;
    --label-color-mobile: #94a3b8;
    --text-color-mobile: #e2e8f0;
    --border-color-mobile: #354456;
}

/* Light theme adjustments */
[data-theme="light"], body.light-theme {
    --card-bg-mobile: #ffffff;
    --card-bg-mobile-alt: #f8f9fa;
    --label-color-mobile: #6c757d;
    --text-color-mobile: #212529;
    --border-color-mobile: #dee2e6;
    --action-border-mobile: rgba(0, 0, 0, 0.1);
}

/* ========================================
   DESKTOP TABLE STYLES (Default)
   ======================================== */

/* Apply to apps, organizations, users, and notifications tables */
#apps-table,
#organizations-table,
#users-table,
#notifications-table,
table[data-mobile-ready="true"] {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

#apps-table thead th,
#organizations-table thead th,
#users-table thead th,
#notifications-table thead th,
table[data-mobile-ready="true"] thead th {
    text-align: left;
    padding: 12px;
    /* background-color: var(--secondary-color, #1a2332); */
    border-bottom: 2px solid var(--border-color, #2a3441);
    font-weight: 600;
    color: var(--text-color, #ffffff);
}

#apps-table tbody td,
#organizations-table tbody td,
#users-table tbody td,
#notifications-table tbody td,
table[data-mobile-ready="true"] tbody td {
    padding: 12px;
    border-bottom: 1px solid var(--border-color, #2a3441);
    vertical-align: middle;
    color: var(--text-color, #ffffff);
}

#apps-table tbody tr:last-child td,
#organizations-table tbody tr:last-child td,
#users-table tbody tr:last-child td,
#notifications-table tbody tr:last-child td,
table[data-mobile-ready="true"] tbody tr:last-child td {
    border-bottom: none;
}

#apps-table.striped tbody tr:nth-child(even),
#organizations-table.striped tbody tr:nth-child(even),
#users-table.striped tbody tr:nth-child(even),
#notifications-table.striped tbody tr:nth-child(even),
table[data-mobile-ready="true"].striped tbody tr:nth-child(even) {
    background-color: rgba(255, 255, 255, 0.02);
}

#apps-table.hover tbody tr:hover,
#organizations-table.hover tbody tr:hover,
#users-table.hover tbody tr:hover,
#notifications-table.hover tbody tr:hover,
table[data-mobile-ready="true"].hover tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

/* Action buttons in table */
#apps-table .view-app-btn,
#apps-table .add-org-btn,
#apps-table .delete-app-btn,
#organizations-table .view-organization-btn,
#organizations-table .delete-organization-btn,
#users-table .view-user-btn,
#users-table .delete-user-btn,
#notifications-table .mark-read-btn,
#notifications-table .mark-unread-btn,
#notifications-table .delete-notification-btn,
table[data-mobile-ready="true"] button {
    /* margin: 0 4px; */
    /* padding: 6px 12px; */
    font-size: 13px;
}

/* ========================================
   MOBILE RESPONSIVE - CARD LAYOUT
   ======================================== */
@media (max-width: 767px) {
    /* Hide table headers on mobile */
    #apps-table thead,
    #organizations-table thead,
    #users-table thead,
    #notifications-table thead,
    table[data-mobile-ready="true"] thead {
        display: none;
    }
    
    /* Remove table border */
    #apps-table,
    #organizations-table,
    #users-table,
    #notifications-table,
    table[data-mobile-ready="true"] {
        border: none;
        margin-top: 0;
    }
    
    #apps-table tbody,
    #organizations-table tbody,
    #users-table tbody,
    #notifications-table tbody,
    table[data-mobile-ready="true"] tbody {
        display: block;
    }
    
    /* Transform each row into a card */
    #apps-table tbody tr,
    #organizations-table tbody tr,
    #users-table tbody tr,
    #notifications-table tbody tr,
    table[data-mobile-ready="true"] tbody tr {
        display: block;
        margin-bottom: 16px;
        background: #253444;
        background: var(--card-bg-mobile, #253444);
        border: 1px solid var(--border-color-mobile, #354456);
        border-radius: 10px;
        padding: 16px;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
        position: relative;
    }
    
    /* Special styling for unread notifications */
    #notifications-table tbody tr.notification-unread {
        background: #2a3d4f;
        background: var(--card-bg-mobile-unread, #2a3d4f);
        border-left: 3px solid #ffc107;
    }
    
    /* Add subtle gradient for depth */
    #apps-table tbody tr::after,
    #organizations-table tbody tr::after,
    #users-table tbody tr::after,
    #notifications-table tbody tr::after,
    table[data-mobile-ready="true"] tbody tr::after {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: linear-gradient(135deg, rgba(255,255,255,0.03) 0%, rgba(255,255,255,0) 100%);
        border-radius: 10px;
        pointer-events: none;
        z-index: 0;
    }
    
    /* Alternating backgrounds for better separation */
    #apps-table tbody tr:nth-child(even),
    #organizations-table tbody tr:nth-child(even),
    #users-table tbody tr:nth-child(even),
    #notifications-table tbody tr:nth-child(even),
    table[data-mobile-ready="true"] tbody tr:nth-child(even) {
        background: #2a3a4d;
        background: var(--card-bg-mobile-alt, #2a3a4d);
    }
    
    /* Remove desktop hover effects */
    #apps-table.hover tbody tr:hover,
    #organizations-table.hover tbody tr:hover,
    #users-table.hover tbody tr:hover,
    #notifications-table.hover tbody tr:hover,
    table[data-mobile-ready="true"].hover tbody tr:hover {
        background-color: var(--card-bg-mobile, #253444);
    }
    
    #apps-table.hover tbody tr:nth-child(even):hover,
    #organizations-table.hover tbody tr:nth-child(even):hover,
    #users-table.hover tbody tr:nth-child(even):hover,
    #notifications-table.hover tbody tr:nth-child(even):hover,
    table[data-mobile-ready="true"].hover tbody tr:nth-child(even):hover {
        background-color: var(--card-bg-mobile-alt, #2a3a4d);
    }
    
    /* Transform cells into labeled rows */
    #apps-table tbody td,
    #organizations-table tbody td,
    #users-table tbody td,
    #notifications-table tbody td,
    table[data-mobile-ready="true"] tbody td {
        display: block;
        text-align: left;
        padding: 8px 0;
        border: none;
        position: relative;
        padding-left: 0;
        width: 100%;
        color: #e2e8f0;
        color: var(--text-color-mobile, #e2e8f0);
        font-size: 14px;
        z-index: 1;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
    
    /* Special handling for notification message cells */
    #notifications-table tbody td.notification-message {
        padding-bottom: 12px;
    }
    
    /* Special handling for notification date fields */
    #notifications-table tbody td:nth-child(3) {
        display: flex;
        flex-wrap: wrap;
        align-items: baseline;
    }
    
    #notifications-table tbody td:nth-child(3)::before {
        flex-shrink: 0;
        white-space: nowrap;
    }
    
    /* Ensure date content wraps properly */
    #notifications-table tbody td small {
        display: inline-block;
        width: 100%;
        margin-top: 4px;
    }
    
    /* Add bold labels using data attributes */
    #apps-table tbody td[data-label]::before,
    #organizations-table tbody td[data-label]::before,
    #users-table tbody td[data-label]::before,
    #notifications-table tbody td[data-label]::before,
    table[data-mobile-ready="true"] tbody td[data-label]::before {
        content: attr(data-label) ": ";
        font-weight: 700;
        color: #94a3b8;
        color: var(--label-color-mobile, #94a3b8);
        display: inline-block;
        margin-right: 8px;
    }
    
    /* Special handling for action buttons */
    #apps-table tbody td:last-child,
    #organizations-table tbody td:last-child,
    #users-table tbody td:last-child,
    #notifications-table tbody td:last-child,
    table[data-mobile-ready="true"] tbody td:last-child {
        padding-top: 14px;
        margin-top: 14px;
        border-top: 1px solid var(--action-border-mobile, rgba(255, 255, 255, 0.1));
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        justify-content: stretch;
    }
    
    /* Remove label from action cells */
    #apps-table tbody td:last-child::before,
    #organizations-table tbody td:last-child::before,
    #users-table tbody td:last-child::before,
    #notifications-table tbody td:last-child::before,
    table[data-mobile-ready="true"] tbody td:last-child::before {
        content: none;
    }
    
    /* Mobile button styling */
    #apps-table button,
    #organizations-table button,
    #users-table button,
    #notifications-table button,
    table[data-mobile-ready="true"] button {
        flex: 1;
        min-width: calc(50% - 4px);
        margin: 0;
        padding: 10px 12px;
        font-size: 14px;
        white-space: nowrap;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 6px;
        border-radius: 6px;
        transition: all 0.2s;
        position: relative;
        z-index: 2;
    }
    
    /* Make delete buttons full width for emphasis */
    #apps-table .delete-app-btn,
    #organizations-table .delete-organization-btn,
    #users-table .delete-user-btn,
    #notifications-table .delete-notification-btn,
    button[class*="delete"] {
        /* min-width: 100%; */
        background-color: #dc3545 !important;
    }
    
    /* View and secondary buttons side-by-side */
    #apps-table .view-app-btn,
    #apps-table .add-org-btn,
    #organizations-table .view-organization-btn,
    #users-table .view-user-btn,
    #notifications-table .mark-read-btn,
    #notifications-table .mark-unread-btn {
        /* min-width: calc(50% - 4px); */
    }
    
    /* Notification status badges on mobile */
    #notifications-table .badge {
        display: inline-block;
        padding: 4px 8px;
        border-radius: 12px;
        font-size: 11px;
        font-weight: 600;
    }
    
    #notifications-table .badge-warning {
        background: #ffc107;
        color: #000;
    }
    
    #notifications-table .badge-success {
        background: #28a745;
        color: #fff;
    }
    
    /* Optional: Add ID badge for apps table */
    #apps-table tbody tr[data-app-id]::before {
        content: attr(data-app-id);
        position: absolute;
        top: 16px;
        right: 16px;
        background: #3b82f6;
        background: var(--badge-color, #3b82f6);
        color: white;
        padding: 5px 12px;
        border-radius: 14px;
        font-size: 12px;
        font-weight: 600;
        line-height: 1;
        box-shadow: 0 2px 4px rgba(59, 130, 246, 0.3);
        z-index: 2;
    }
    
    /* Optional: Add org badge for organizations table */
    #organizations-table tbody tr[data-org-id]::before {
        content: attr(data-org-id);
        position: absolute;
        top: 16px;
        right: 16px;
        background: #22c55e;
        background: var(--badge-color-org, #22c55e);
        color: white;
        padding: 5px 12px;
        border-radius: 14px;
        font-size: 12px;
        font-weight: 600;
        line-height: 1;
        box-shadow: 0 2px 4px rgba(34, 197, 94, 0.3);
        z-index: 2;
    }
    
    /* Optional: Add user badge for users table */
    #users-table tbody tr[data-user-id]::before {
        content: attr(data-user-id);
        position: absolute;
        top: 16px;
        right: 16px;
        background: #a855f7;
        background: var(--badge-color-user, #a855f7);
        color: white;
        padding: 5px 12px;
        border-radius: 14px;
        font-size: 12px;
        font-weight: 600;
        line-height: 1;
        box-shadow: 0 2px 4px rgba(168, 85, 247, 0.3);
        z-index: 2;
    }
    
    /* Optional: Add notification badge/indicator */
    #notifications-table tbody tr[data-notification-id]::before {
        content: '🔔';
        position: absolute;
        top: 16px;
        right: 16px;
        background: #ffc107;
        background: var(--badge-color-notification, #ffc107);
        padding: 5px 10px;
        border-radius: 50%;
        font-size: 14px;
        line-height: 1;
        box-shadow: 0 2px 4px rgba(255, 193, 7, 0.3);
        z-index: 2;
    }
    
    /* Different badge for read notifications */
    #notifications-table tbody tr.notification-read[data-notification-id]::before {
        background: #6c757d;
        background: var(--badge-color-notification-read, #6c757d);
        opacity: 0.7;
    }
}

/* Small mobile devices */
@media (max-width: 480px) {
    #apps-table tbody tr,
    #organizations-table tbody tr,
    table[data-mobile-ready="true"] tbody tr {
        padding: 14px;
        margin-bottom: 12px;
    }
    
    /* Stack all buttons vertically on very small screens */
    #apps-table button,
    #organizations-table button,
    table[data-mobile-ready="true"] button {
        min-width: 100%;
    }
}

/* Landscape mobile adjustments */
@media (max-width: 767px) and (orientation: landscape) {
    #apps-table tbody tr,
    #organizations-table tbody tr,
    table[data-mobile-ready="true"] tbody tr {
        margin-bottom: 12px;
        padding: 12px;
    }
    
    /* Keep view buttons side-by-side in landscape */
    #apps-table .view-app-btn,
    #apps-table .add-org-btn,
    #organizations-table .view-organization-btn {
        min-width: calc(50% - 4px);
    }
}

/* Base Modal Styles (Dark Theme Default) */
.atlas-modal-content {
    background-color: #1a2332;
    color: white;
    border-radius: 12px;
    overflow: hidden;
}

.atlas-modal-header {
    background-color: #1a2332;
    border-bottom: 1px solid #2a3441;
}

.atlas-modal-header h2 {
    color: white;
}

.atlas-modal-body {
    background-color: #1a2332;
    color: white;
}

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

/* Light Theme Modal Styles */
body.light-theme .atlas-modal-content,
[data-theme="light"] .atlas-modal-content {
    background-color: #ffffff;
    color: #1e293b;
}

body.light-theme .atlas-modal-header,
[data-theme="light"] .atlas-modal-header {
    border-bottom: 1px solid #e2e8f0;
    background-color: #ffffff;
}

body.light-theme .atlas-modal-header h2,
[data-theme="light"] .atlas-modal-header h2 {
    color: #1e293b;
}

body.light-theme .atlas-modal-close,
[data-theme="light"] .atlas-modal-close {
    color: #64748b;
}

body.light-theme .atlas-modal-close:hover,
[data-theme="light"] .atlas-modal-close:hover {
    color: #1e293b;
}

body.light-theme .atlas-modal-body,
[data-theme="light"] .atlas-modal-body {
    background-color: #ffffff;
    color: #1e293b;
}

body.light-theme .atlas-modal-footer,
[data-theme="light"] .atlas-modal-footer {
    border-top: 1px solid #e2e8f0;
    background-color: #ffffff;
}

.form-buttons {
    display: none;
}