/* CSS Variables for Brand Colors - Light Mode */
:root {
    --brand-color: rgb(175, 100, 100);
    --brand-color-hover: rgba(175, 100, 100, 0.8);
    --brand-color-light: rgba(175, 100, 100, 0.15);
    --brand-color-lighter: rgba(175, 100, 100, 0.08);
    --background-light: #f5f5f5;
    --background-white: #ffffff;
    --background-card: #ffffff;
    --text-dark: #333333;
    --text-light: #ffffff;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --shadow-color: rgba(0, 0, 0, 0.1);
}

/* Dark Mode Variables */
[data-theme="dark"] {
    --brand-color: rgb(175, 100, 100);
    --brand-color-hover: rgba(175, 100, 100, 0.8);
    --brand-color-light: rgba(175, 100, 100, 0.25);
    --brand-color-lighter: rgba(175, 100, 100, 0.12);
    --background-light: #0f0f0f;
    --background-white: #1a1a1a;
    --background-card: #1e1e1e;
    --text-dark: #f5f5f5;
    --text-light: #ffffff;
    --text-muted: #b0b0b0;
    --border-color: #333333;
    --shadow-color: rgba(0, 0, 0, 0.5);
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background: linear-gradient(to bottom, var(--background-light), var(--background-white));
    transition: background-color 0.3s ease, color 0.3s ease;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.header {
    background: var(--brand-color);
    border-bottom: 1px solid var(--brand-color-hover);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    min-height: 60px;
}

.logo {
    flex-shrink: 0;
    min-width: 200px;
}

.logo h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-light);
    margin: 0;
}

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

.nav-list {
    display: flex;
    list-style: none;
    gap: 2rem;
    align-items: center;
    margin: 0;
    padding: 0;
    flex: 1;
    justify-content: center;
}

.nav-list a {
    text-decoration: none;
    color: var(--text-light);
    font-weight: 500;
    transition: color 0.2s;
    padding: 0.5rem 0;
    white-space: nowrap;
}

.nav-list a:hover {
    color: #f0f0f0;
}

/* User Profile Dropdown */
.user-profile {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-shrink: 0;
    min-width: 200px;
    justify-content: flex-end;
}

.profile-dropdown {
    position: relative;
}

.profile-button {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--brand-color);
    border: 2px solid var(--text-light);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    color: var(--text-light);
    font-weight: 600;
    font-size: 0.9rem;
}

.profile-button:hover {
    background: var(--brand-color-hover);
    transform: scale(1.05);
}

.profile-button:active {
    transform: scale(0.95);
}

.profile-initials {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-light);
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--background-card);
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    box-shadow: 0 10px 25px var(--shadow-color);
    min-width: 200px;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    margin-top: 0.5rem;
}

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

.dropdown-header {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.user-name {
    display: block;
    font-weight: 600;
    color: var(--text-dark);
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
}

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

.dropdown-divider {
    height: 1px;
    background: var(--border-color);
    margin: 0.5rem 0;
}

.dropdown-item {
    display: block;
    padding: 0.75rem 1rem;
    color: var(--text-dark);
    text-decoration: none;
    font-size: 0.9rem;
    transition: background-color 0.2s ease;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
}

.dropdown-item:hover {
    background: var(--background-light);
}

.dropdown-item.logout {
    color: #dc2626;
}

.dropdown-item.logout:hover {
    background: rgba(220, 38, 38, 0.1);
}


/* Theme Toggle Switch */
.theme-toggle-container {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}

.theme-toggle-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: color 0.3s ease;
    min-width: 35px;
    text-align: center;
    color: var(--text-light);
}

.theme-toggle-label.dark {
    opacity: 0.6;
}

.theme-toggle-label.light {
    opacity: 1;
}

.theme-toggle {
    position: relative;
    width: 60px;
    height: 28px;
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 14px;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    padding: 2px;
}

.theme-toggle:hover {
    background-color: rgba(255, 255, 255, 0.3);
}

.theme-toggle::before {
    content: '';
    position: absolute;
    width: 24px;
    height: 24px;
    background-color: var(--text-light);
    border-radius: 50%;
    transition: all 0.3s ease;
    right: 2px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.theme-toggle[data-theme="dark"]::before {
    transform: translateX(-32px);
    background: #f5f5f5;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    mask: radial-gradient(circle at 70% 50%, transparent 50%, black 50%);
    -webkit-mask: radial-gradient(circle at 70% 50%, transparent 50%, black 50%);
}

/* Dark mode toggle styling */
[data-theme="dark"] .theme-toggle {
    background-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .theme-toggle:hover {
    background-color: rgba(255, 255, 255, 0.2);
}


[data-theme="dark"] .theme-toggle-label.dark {
    opacity: 1;
}

[data-theme="dark"] .theme-toggle-label.light {
    opacity: 0.6;
}

/* Theme Toggle in Dropdown Menu */
.dropdown-theme-toggle {
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dropdown-theme-toggle .theme-toggle-container {
    width: 100%;
    justify-content: center;
}

.dropdown-theme-toggle .theme-toggle-label {
    color: var(--text-dark);
}

.dropdown-theme-toggle .theme-toggle {
    background-color: var(--border-color);
}

.dropdown-theme-toggle .theme-toggle:hover {
    background-color: var(--text-muted);
}

.dropdown-theme-toggle .theme-toggle::before {
    background-color: var(--text-dark);
}

.dropdown-theme-toggle .theme-toggle[data-theme="dark"]::before {
    background: var(--text-dark);
}

[data-theme="dark"] .dropdown-theme-toggle .theme-toggle {
    background-color: var(--border-color);
}

[data-theme="dark"] .dropdown-theme-toggle .theme-toggle:hover {
    background-color: var(--text-muted);
}

.role-badge {
    padding: 0.125rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    white-space: nowrap;
    display: inline-block;
}

.role-badge.admin {
    background-color: #fef3c7;
    color: #92400e;
}

.role-badge.user {
    background-color: #dbeafe;
    color: #1e40af;
}

/* Main Content */
.main {
    min-height: calc(100vh - 140px);
    padding: 2rem 0;
    background: linear-gradient(to bottom, var(--background-light), var(--background-white));
}

/* Flash Messages */
.flash-messages {
    margin-bottom: 1.5rem;
}

.flash {
    padding: 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
    font-weight: 500;
}

.flash-error {
    background-color: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

.flash-success {
    background-color: #f0fdf4;
    color: #16a34a;
    border: 1px solid #bbf7d0;
}

.flash-warning {
    background-color: #fffbeb;
    color: #d97706;
    border: 1px solid #fed7aa;
}

/* Cards */
.card {
    background: var(--background-card);
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px var(--shadow-color);
    margin-bottom: 2rem;
    overflow: hidden;
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.card-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    background: linear-gradient(to bottom, var(--background-light), var(--background-white));
    transition: background-color 0.3s ease, border-color 0.3s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-dark);
    transition: color 0.3s ease;
}

.card-body {
    padding: 1.5rem;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}


.btn-primary {
    background-color: var(--brand-color);
    color: var(--text-light);
}

.btn-primary:hover {
    background-color: var(--brand-color-hover);
}

.btn-secondary {
    background-color: #64748b;
    color: #fff;
}

.btn-secondary:hover {
    background-color: #475569;
}

.btn-success {
    background-color: #16a34a;
    color: #fff;
}

.btn-success:hover {
    background-color: #15803d;
}

.btn-danger {
    background-color: #dc2626;
    color: #fff;
}

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

.btn-warning {
    background-color: #d97706;
    color: #fff;
}

.btn-warning:hover {
    background-color: #b45309;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.75rem;
}

.btn-full {
    width: 100%;
    justify-content: center;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Forms */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - 140px);
    padding: 2rem;
}

.auth-card {
    background: var(--background-card);
    border-radius: 1rem;
    box-shadow: 0 10px 25px var(--shadow-color);
    padding: 2rem;
    width: 100%;
    max-width: 400px;
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-header .setup-intro-text {
    margin-bottom: 2rem;
}

.auth-header h2 {
    font-size: 1.875rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
    transition: color 0.3s ease;
}

.auth-header p {
    color: var(--text-muted);
    transition: color 0.3s ease;
}

.auth-form {
    margin-bottom: 1.5rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-dark);
    transition: color 0.3s ease;
}

.form-group input,
.form-group select,
.form-control {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    font-size: 1rem;
    background-color: var(--background-card);
    color: var(--text-dark);
    transition: border-color 0.2s, background-color 0.3s ease, color 0.3s ease;
}

.form-group select,
select.form-control {
    padding-right: 2.5rem;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748b' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 0.75rem;
}

.form-group input:focus,
.form-group select:focus,
.form-control:focus {
    outline: none;
    border-color: var(--brand-color);
    box-shadow: 0 0 0 3px var(--brand-color-light);
}

.form-help {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.875rem;
    color: var(--text-muted);
    transition: color 0.3s ease;
}

.auth-footer {
    text-align: center;
    color: var(--text-muted);
    transition: color 0.3s ease;
}

.auth-footer a {
    color: var(--brand-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

.auth-footer a:hover {
    text-decoration: underline;
    color: var(--brand-color-hover);
}

/* Dashboard */
.dashboard-header {
    margin-bottom: 2rem;
}

.dashboard-header h1 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
    transition: color 0.3s ease;
}

.dashboard-header p {
    color: var(--text-muted);
    font-size: 1.125rem;
    transition: color 0.3s ease;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

/* Profile */
.profile-header {
    margin-bottom: 2rem;
}

.profile-header h1 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
    transition: color 0.3s ease;
}

.profile-header p {
    color: var(--text-muted);
    font-size: 1.125rem;
    transition: color 0.3s ease;
}

.profile-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-color);
    transition: border-color 0.3s ease;
}

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

.info-item label {
    font-weight: 500;
    color: var(--text-muted);
    transition: color 0.3s ease;
}

.info-item span {
    color: var(--text-dark);
    font-weight: 500;
    transition: color 0.3s ease;
}

/* Device Stats */
.device-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.stat-box {
    background: var(--background-white);
    border-radius: 0.5rem;
    padding: 1rem;
    text-align: center;
    transition: background-color 0.3s ease;
}

.stat-number {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
    color: var(--text-dark);
    transition: color 0.3s ease;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-muted);
    transition: color 0.3s ease;
}

.stat-item {
    text-align: center;
    padding: 1rem;
    background-color: var(--background-light);
    border-radius: 0.5rem;
    transition: background-color 0.3s ease;
}

.stat-number {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.stat-number.authorized {
    color: #16a34a;
}

.stat-number.pending {
    color: #d97706;
}

.stat-number.revoked {
    color: #dc2626;
}

.stat-number.inactive {
    color: var(--text-muted);
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-muted);
    font-weight: 500;
    transition: color 0.3s ease;
}

/* Tables */
.table-responsive {
    overflow-x: auto;
    margin: 0 -1.5rem;
    padding: 0;
    width: calc(100% + 3rem);
    background-color: var(--background-card);
}

.table {
    width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
    margin-top: 0;
    border: none;
    box-sizing: border-box;
}

/* Column width distribution for admin devices table */
.table th:nth-child(1),
.table td:nth-child(1) {
    width: 27%;
}

.table th:nth-child(2),
.table td:nth-child(2) {
    width: 12%;
}

.table th:nth-child(3),
.table td:nth-child(3) {
    width: 10%;
}

.table th:nth-child(4),
.table td:nth-child(4) {
    width: 12%;
}

.table th:nth-child(5),
.table td:nth-child(5) {
    width: 11%;
}

.table th:nth-child(6),
.table td:nth-child(6) {
    width: 11%;
}

.table th:nth-child(7),
.table td:nth-child(7) {
    width: 140px;
    min-width: 140px;
}

/* Prevent wrapping in specific device table columns */
.table th:nth-child(2),
.table td:nth-child(2) {
    white-space: nowrap;
}

.table th:nth-child(3),
.table td:nth-child(3) {
    white-space: nowrap;
}

.table th:nth-child(4),
.table td:nth-child(4) {
    white-space: nowrap;
}

.table th:nth-child(5),
.table td:nth-child(5) {
    white-space: nowrap;
}

.table th:nth-child(6),
.table td:nth-child(6) {
    white-space: nowrap;
}


.table th,
.table td {
    padding: 0.875rem 1.5rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
    transition: border-color 0.3s ease;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.table th:first-child,
.table td:first-child {
    padding-left: 1.5rem;
}

.table th:last-child,
.table td:last-child {
    padding-right: 1.5rem;
}

/* Ensure table cells account for padding in width calculations */
.table th,
.table td {
    box-sizing: border-box;
}

.table th {
    background-color: var(--brand-color);
    font-weight: 600;
    color: var(--text-light);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0;
    white-space: normal;
    line-height: 1.4;
    vertical-align: middle;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
}

.table tbody tr {
    transition: background-color 0.2s ease;
}

.table tbody tr:hover {
    background-color: var(--background-light);
}

.table tbody tr:last-child td {
    border-bottom: none;
}


.device-id {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    background-color: var(--background-light);
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    transition: background-color 0.3s ease;
}

.status-badge {
    padding: 0.1875rem 0.625rem;
    border-radius: 9999px;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    display: inline-block;
    white-space: nowrap;
}

.status-authorized {
    background-color: #dcfce7;
    color: #166534;
}

.status-pending_approval {
    background-color: #fef3c7;
    color: #92400e;
}

.status-revoked {
    background-color: #fecaca;
    color: #991b1b;
}

.status-inactive {
    background-color: #e2e8f0;
    color: #475569;
}

/* Authorization and session info display */
.authorization-info,
.session-info {
    display: block;
}

.expiry-status,
.session-time {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
}

.expiry-status svg,
.expiry-status i,
.session-time svg,
.session-time i {
    font-size: 0.875rem;
    opacity: 0.7;
    flex-shrink: 0;
}

.table td .text-muted {
    font-size: 0.8125rem;
    opacity: 0.7;
}

.device-count-link {
    color: var(--text-dark);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease, text-decoration 0.2s ease;
}

.device-count-link:hover {
    color: var(--text-dark);
    text-decoration: underline;
}

[data-theme="dark"] .device-count-link {
    color: var(--text-dark);
}

[data-theme="dark"] .device-count-link:hover {
    color: var(--text-dark);
}

.action-buttons {
    display: flex;
    gap: 0.375rem;
    flex-wrap: wrap;
}

.action-buttons-vertical {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
    align-items: stretch;
    min-width: 0;
}

.action-buttons-vertical .btn {
    width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.action-buttons-vertical .role-select {
    width: 100%;
}

/* Table Action Dropdown */
.table-action-dropdown {
    position: relative;
    display: inline-block;
}

.action-dropdown-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 0.875rem;
    font-size: 0.75rem;
    white-space: nowrap;
}

.dropdown-arrow {
    font-size: 0.625rem;
    transition: transform 0.2s ease;
}

.table-action-dropdown.active .dropdown-arrow {
    transform: rotate(180deg);
}

.table-dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.25rem;
    background: var(--background-card);
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    min-width: 140px;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
}

.table-action-dropdown.active .table-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.table-dropdown-item {
    display: block;
    width: 100%;
    padding: 0.625rem 0.875rem;
    text-align: left;
    background: none;
    border: none;
    color: var(--text-dark);
    font-size: 0.8125rem;
    cursor: pointer;
    transition: background-color 0.15s ease;
    white-space: nowrap;
}

.table-dropdown-item:first-child {
    border-top-left-radius: 0.375rem;
    border-top-right-radius: 0.375rem;
}

.table-dropdown-item:last-child {
    border-bottom-left-radius: 0.375rem;
    border-bottom-right-radius: 0.375rem;
}

.table-dropdown-item:hover {
    background-color: var(--background-light);
}

.table-dropdown-item.text-success {
    color: #16a34a;
}

.table-dropdown-item.text-success:hover {
    background-color: rgba(22, 163, 74, 0.1);
}

.table-dropdown-item.text-danger {
    color: #dc2626;
}

.table-dropdown-item.text-danger:hover {
    background-color: rgba(220, 38, 38, 0.1);
}

.table-dropdown-item.text-warning {
    color: #ca8a04;
}

.table-dropdown-item.text-warning:hover {
    background-color: rgba(202, 138, 4, 0.1);
}

.user-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 0;
}

.user-name-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.user-info strong {
    font-weight: 600;
    font-size: 0.875rem;
}

/* Combined User & Device Column */
.user-device-combined {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    min-width: 0;
}

.user-device-header {
    margin-bottom: 0.125rem;
}

.user-info-inline {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: nowrap;
    white-space: nowrap;
}

.user-info-inline strong {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-dark);
    white-space: nowrap;
}

.user-device-combined .device-info {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    min-width: 0;
}

.user-device-combined .device-name-row {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    flex-wrap: nowrap;
    white-space: nowrap;
}

.user-device-combined .device-name {
    flex-shrink: 0;
}

.user-device-combined .current-badge,
.user-device-combined .logged-in-badge {
    flex-shrink: 0;
    white-space: nowrap;
}

.user-device-combined .device-details {
    min-width: 0;
    flex: 1;
}

.user-device-combined .device-type {
    white-space: normal;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Admin Dashboard */
.dashboard-top-section {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    align-items: stretch;
}

.admin-dashboard .stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.875rem;
    flex: 1;
    min-width: 0;
}

.admin-page .stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.875rem;
    flex: 1;
    min-width: 0;
}

.admin-page .dashboard-top-section {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    align-items: stretch;
}

.quick-actions-card {
    background: var(--background-card);
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px var(--shadow-color);
    padding: 1rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 200px;
    flex-shrink: 0;
}

.quick-actions-header {
    margin-bottom: 0.75rem;
}

.quick-actions-header h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-dark);
    margin: 0;
    transition: color 0.3s ease;
}

/* Column width distribution for admin dashboard table (4 columns) */
.admin-dashboard .table th:nth-child(1),
.admin-dashboard .table td:nth-child(1) {
    width: 45%;
}

.admin-dashboard .table th:nth-child(2),
.admin-dashboard .table td:nth-child(2) {
    width: 15%;
}

.admin-dashboard .table th:nth-child(3),
.admin-dashboard .table td:nth-child(3) {
    width: 15%;
}

.admin-dashboard .table th:nth-child(4),
.admin-dashboard .table td:nth-child(4) {
    width: 25%;
}

/* Column width distribution for admin users table (6 columns) */
#usersTable th:nth-child(1),
#usersTable td:nth-child(1) {
    width: 26%;
}

#usersTable th:nth-child(2),
#usersTable td:nth-child(2) {
    width: 12%;
}

#usersTable th:nth-child(3),
#usersTable td:nth-child(3) {
    width: 10%;
}

#usersTable th:nth-child(4),
#usersTable td:nth-child(4) {
    width: 14%;
}

#usersTable th:nth-child(5),
#usersTable td:nth-child(5) {
    width: 14%;
}

#usersTable th:nth-child(6),
#usersTable td:nth-child(6) {
    width: 24%;
}

/* Prevent wrapping in specific user table columns */
#usersTable th:nth-child(2),
#usersTable td:nth-child(2) {
    white-space: nowrap;
}

#usersTable th:nth-child(3),
#usersTable td:nth-child(3) {
    white-space: nowrap;
}

#usersTable th:nth-child(4),
#usersTable td:nth-child(4) {
    white-space: nowrap;
}

#usersTable th:nth-child(5),
#usersTable td:nth-child(5) {
    white-space: nowrap;
}

#usersTable th:nth-child(6),
#usersTable td:nth-child(6) {
    white-space: nowrap;
}

/* Center align headers and content for ROLE, DEVICES, and ACTIONS columns */
#usersTable th:nth-child(2),
#usersTable td:nth-child(2) {
    text-align: center;
}

#usersTable th:nth-child(3),
#usersTable td:nth-child(3) {
    text-align: center;
}

#usersTable th:nth-child(6),
#usersTable td:nth-child(6) {
    text-align: center;
}

/* Column width distribution for pending devices table */
#pendingDevicesTable th:nth-child(1),
#pendingDevicesTable td:nth-child(1) {
    width: 45%;
}

#pendingDevicesTable th:nth-child(2),
#pendingDevicesTable td:nth-child(2) {
    width: 15%;
    white-space: nowrap;
}

#pendingDevicesTable th:nth-child(3),
#pendingDevicesTable td:nth-child(3) {
    width: 15%;
    white-space: nowrap;
}

#pendingDevicesTable th:nth-child(4),
#pendingDevicesTable td:nth-child(4) {
    width: 140px;
    min-width: 140px;
}

/* Admin Navigation */
.admin-nav {
    background: var(--background-card);
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 1.5rem;
    padding: 0;
    box-shadow: 0 1px 3px var(--shadow-color);
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.admin-nav-container {
    display: flex;
    gap: 0;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.admin-nav-item {
    display: inline-block;
    padding: 0.875rem 1.25rem;
    text-decoration: none;
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.9375rem;
    border-bottom: 3px solid transparent;
    transition: all 0.2s ease;
    position: relative;
    white-space: nowrap;
}

.admin-nav-item:hover {
    color: var(--text-dark);
    background-color: var(--background-light);
}

.admin-nav-item.active {
    color: var(--brand-color);
    border-bottom-color: var(--brand-color);
    background-color: var(--brand-color-lighter);
}

/* Breadcrumbs */
.breadcrumb {
    margin-bottom: 1.5rem;
    padding: 0;
}

.breadcrumb-list {
    display: flex;
    align-items: center;
    list-style: none;
    margin: 0;
    padding: 0;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.breadcrumb-item {
    display: flex;
    align-items: center;
}

.breadcrumb-item a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.875rem;
    transition: color 0.2s ease;
}

.breadcrumb-item a:hover {
    color: var(--brand-color);
    text-decoration: underline;
}

.breadcrumb-item.active span {
    color: var(--text-dark);
    font-size: 0.875rem;
    font-weight: 500;
}

.breadcrumb-separator {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin: 0 0.25rem;
    opacity: 0.6;
}

/* Page Headers */
.page-header h1 {
    color: var(--text-dark);
    transition: color 0.3s ease;
}

.page-header p {
    color: var(--text-muted);
    transition: color 0.3s ease;
}

.stat-card {
    background: var(--background-card);
    border-radius: 0.5rem;
    padding: 0.75rem 0.625rem;
    box-shadow: 0 1px 3px var(--shadow-color);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.stat-card.clickable-stat {
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}

.stat-card.clickable-stat:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--shadow-color);
    background-color: var(--background-light);
}

.stat-content h3.pending {
    color: #d97706;
}

.stat-content h3.inactive {
    color: var(--text-muted);
}

.stat-icon {
    width: 3rem;
    height: 3rem;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--text-light);
    background-color: var(--brand-color);
}

.stat-card.pending .stat-icon {
    background-color: #d97706;
}

.stat-card.inactive .stat-icon {
    background-color: #64748b;
}

.stat-content {
    text-align: center;
}

.stat-content h3 {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 0.25rem;
    transition: color 0.3s ease;
    line-height: 1.2;
}

.stat-content p {
    color: var(--text-muted);
    font-size: 1rem;
    transition: color 0.3s ease;
    margin: 0;
    line-height: 1.4;
}

.quick-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.quick-actions-card .quick-actions {
    flex-direction: column;
    gap: 0.75rem;
}

.card-body .quick-actions {
    flex-direction: column;
    gap: 0.75rem;
}

/* Admin Pages */
.admin-page .page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.admin-page .page-header h1 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-dark);
    transition: color 0.3s ease;
}

.header-actions {
    display: flex;
    gap: 1rem;
}

/* Modals */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: var(--background-card);
    border-radius: 0.75rem;
    box-shadow: 0 20px 25px var(--shadow-color);
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: border-color 0.3s ease;
}

.modal-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-dark);
    transition: color 0.3s ease;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-dark);
    cursor: pointer;
    transition: color 0.3s ease;
}

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

.modal-body {
    padding: 1.5rem;
}

/* Button Variants */
.btn-outline-primary {
    background-color: transparent;
    border: 2px solid var(--brand-color);
    color: var(--brand-color);
    transition: all 0.3s ease;
}

.btn-outline-primary:hover {
    background-color: var(--brand-color);
    color: var(--text-light);
}

.btn-outline-secondary {
    background-color: rgba(0, 0, 0, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-dark);
    font-weight: 500;
    transition: background-color 0.3s ease 0s, border-color 0.3s ease 0s, color 0.3s ease 0s, font-weight 0.3s ease 0s;
    will-change: border-color, font-weight;
}

[data-theme="dark"] .btn-outline-secondary {
    background-color: rgba(255, 255, 255, 0.07);
}

.btn-outline-secondary:hover {
    background-color: rgba(0, 0, 0, 0.08);
    border-color: var(--text-muted);
    font-weight: 600;
}

[data-theme="dark"] .btn-outline-secondary:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.btn-outline-success {
    background-color: rgba(22, 163, 74, 0.05);
    border: 1px solid rgba(22, 163, 74, 0.4);
    color: #16a34a;
    font-weight: 500;
    transition: background-color 0.3s ease 0s, border-color 0.3s ease 0s, color 0.3s ease 0s, font-weight 0.3s ease 0s;
    will-change: border-color, font-weight;
}

[data-theme="dark"] .btn-outline-success {
    background-color: rgba(22, 163, 74, 0.07);
    border-color: rgba(22, 163, 74, 0.5);
}

.btn-outline-success:hover {
    background-color: rgba(22, 163, 74, 0.08);
    border-color: #16a34a;
    color: #16a34a;
    font-weight: 600;
}

[data-theme="dark"] .btn-outline-success:hover {
    background-color: rgba(22, 163, 74, 0.1);
    border-color: #16a34a;
}

.btn-outline-danger {
    background-color: rgba(220, 38, 38, 0.05);
    border: 1px solid rgba(220, 38, 38, 0.4);
    color: #dc2626;
    font-weight: 500;
    transition: background-color 0.3s ease 0s, border-color 0.3s ease 0s, color 0.3s ease 0s, font-weight 0.3s ease 0s;
    will-change: border-color, font-weight;
}

[data-theme="dark"] .btn-outline-danger {
    background-color: rgba(220, 38, 38, 0.07);
    border-color: rgba(220, 38, 38, 0.5);
}

.btn-outline-danger:hover {
    background-color: rgba(220, 38, 38, 0.08);
    border-color: #dc2626;
    color: #dc2626;
    font-weight: 600;
}

[data-theme="dark"] .btn-outline-danger:hover {
    background-color: rgba(220, 38, 38, 0.1);
}

/* Text Utilities */
.text-muted {
    color: var(--text-muted) !important;
    transition: color 0.3s ease;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
    transition: color 0.3s ease;
}

/* Form Actions */
.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 1.5rem;
}

/* Role Select */
.role-select {
    padding: 0.25rem 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 0.25rem;
    background-color: var(--background-card);
    color: var(--text-dark);
    font-size: 0.875rem;
    transition: all 0.3s ease;
}

.role-select:focus {
    outline: none;
    border-color: var(--brand-color);
    box-shadow: 0 0 0 2px var(--brand-color-light);
}

/* Device Name */
.device-name {
    font-weight: 500;
    color: var(--text-dark);
    transition: color 0.3s ease;
}

/* Error Messages */
.error-message {
    background-color: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
    padding: 0.75rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
    font-size: 0.875rem;
    transition: all 0.3s ease;
}

[data-theme="dark"] .error-message {
    background-color: rgba(220, 38, 38, 0.1);
    color: #fca5a5;
    border-color: rgba(220, 38, 38, 0.3);
}

/* Success Messages */
.success-message {
    background-color: #f0fdf4;
    color: #16a34a;
    border: 1px solid #bbf7d0;
    padding: 0.75rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
    font-size: 0.875rem;
    transition: all 0.3s ease;
}

[data-theme="dark"] .success-message {
    background-color: rgba(22, 163, 74, 0.1);
    color: #86efac;
    border-color: rgba(22, 163, 74, 0.3);
}

/* Passkey Indicator */
.passkey-indicator {
    text-align: center;
    padding: 2rem;
}

.spinner {
    width: 2rem;
    height: 2rem;
    border: 3px solid var(--border-color);
    border-top: 3px solid var(--brand-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

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

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 1.5rem;
}


/* Setup Page */
.setup-card {
    max-width: 500px;
}

.setup-info {
    background-color: var(--background-light);
    border-radius: 0.5rem;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    transition: background-color 0.3s ease;
}

.setup-info h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 1rem;
    transition: color 0.3s ease;
}

.setup-info ul {
    list-style: none;
    padding: 0;
}

.setup-info li {
    padding: 0.5rem 0;
    color: var(--text-muted);
    position: relative;
    padding-left: 1.5rem;
    transition: color 0.3s ease;
}

.setup-info li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: #16a34a;
    font-weight: 600;
}

/* Table Filters */
.table-filters {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
    align-items: flex-end;
}

.table-filters .form-group {
    margin-bottom: 0;
}

/* Empty States */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-muted);
    transition: color 0.3s ease;
}

.empty-state p {
    font-size: 1.125rem;
    margin-bottom: 0.5rem;
}

.no-devices {
    text-align: center;
    color: var(--text-muted);
    font-style: italic;
    padding: 2rem;
    transition: color 0.3s ease;
}

/* Error Page */
.error-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    text-align: center;
}

.error-content h1 {
    font-size: 6rem;
    font-weight: 700;
    color: var(--text-muted);
    margin-bottom: 1rem;
    transition: color 0.3s ease;
}

.error-content h2 {
    font-size: 2rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 1rem;
    transition: color 0.3s ease;
}

.error-content p {
    color: var(--text-muted);
    font-size: 1.125rem;
    margin-bottom: 2rem;
    transition: color 0.3s ease;
}

/* Footer */
.footer {
    background: var(--background-card);
    border-top: 1px solid var(--border-color);
    padding: 1.5rem 0;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.875rem;
    transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}

/* Responsive Design */
@media (max-width: 768px) {
    .header-content {
        flex-direction: row;
        justify-content: space-between;
        gap: 1rem;
        padding: 1rem 0;
        min-height: auto;
    }
    
    .logo {
        min-width: auto;
        text-align: left;
        flex-shrink: 0;
    }
    
    .nav-list {
        gap: 1.5rem;
        flex: none;
        justify-content: center;
    }
    
    .user-profile {
        flex-direction: row;
        gap: 0.75rem;
        justify-content: flex-end;
        min-width: auto;
        flex-shrink: 0;
    }
    
    .profile-button {
        width: 36px;
        height: 36px;
        font-size: 0.8rem;
    }
    
    .dropdown-menu {
        min-width: 180px;
    }
    
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    
    .profile-grid {
        grid-template-columns: 1fr;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .dashboard-top-section {
        flex-direction: column;
    }
    
    .admin-dashboard .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .admin-page .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .quick-actions-card {
        min-width: auto;
    }
    
    .admin-page .page-header {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }
    
    .admin-nav-container {
        padding: 0 1rem;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .admin-nav-item {
        padding: 0.875rem 1rem;
        font-size: 0.875rem;
    }
    
    .breadcrumb-list {
        font-size: 0.8125rem;
    }
    
    .quick-actions {
        justify-content: center;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .table-dropdown-menu {
        right: auto;
        left: 0;
    }
    
    .table-responsive {
        font-size: 0.875rem;
    }
    
    .modal-content {
        width: 95%;
        margin: 1rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 1rem;
    }
    
    .auth-card {
        padding: 1.5rem;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .admin-dashboard .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .admin-page .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .admin-nav-item {
        padding: 0.75rem 0.875rem;
        font-size: 0.8125rem;
    }
    
    .breadcrumb-list {
        font-size: 0.75rem;
    }
    
    .device-stats {
        grid-template-columns: 1fr;
    }
    
    .nav-list {
        gap: 1rem;
    }
    
    .user-profile {
        gap: 0.5rem;
    }
    
    .profile-button {
        width: 32px;
        height: 32px;
        font-size: 0.75rem;
    }
    
    .dropdown-menu {
        min-width: 160px;
        right: -10px;
    }
    
    .theme-toggle-container {
        gap: 0.5rem;
    }
    
    .theme-toggle-label {
        font-size: 0.7rem;
        min-width: 30px;
    }
    
    .theme-toggle {
        width: 50px;
        height: 24px;
    }
    
    .theme-toggle::before {
        width: 20px;
        height: 20px;
    }
    
    .theme-toggle[data-theme="dark"]::before {
        transform: translateX(-26px);
        background: #f5f5f5;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
        mask: radial-gradient(circle at 70% 50%, transparent 50%, black 50%);
        -webkit-mask: radial-gradient(circle at 70% 50%, transparent 50%, black 50%);
    }
}

/* Utility Classes */
.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.mb-0 {
    margin-bottom: 0;
}

.mb-1 {
    margin-bottom: 0.5rem;
}

.mb-2 {
    margin-bottom: 1rem;
}

.mb-3 {
    margin-bottom: 1.5rem;
}

.mt-0 {
    margin-top: 0;
}

.mt-1 {
    margin-top: 0.5rem;
}

.mt-2 {
    margin-top: 1rem;
}

.mt-3 {
    margin-top: 1.5rem;
}

.hidden {
    display: none;
}

.visible {
    display: block;
}

/* Loading States */
.btn-loading {
    display: none;
}

.btn:disabled .btn-text {
    display: none;
}

.btn:disabled .btn-loading {
    display: inline;
}

/* Enhanced Device Display Styles */
.device-info {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    min-width: 0;
}

.device-icon {
    font-size: 1.375rem;
    flex-shrink: 0;
    opacity: 0.8;
}

.device-details {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 0;
    flex: 1;
}

.device-name-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.device-name {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-dark);
}

.device-type {
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 400;
    white-space: normal;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.device-type .separator {
    margin: 0 0.5rem;
    opacity: 0.5;
}

.current-badge,
.logged-in-badge {
    padding: 0.125rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    white-space: nowrap;
}

.current-badge {
    background-color: var(--brand-color-light);
    color: var(--brand-color);
}

.logged-in-badge {
    background-color: rgba(23, 162, 184, 0.15);
    color: #17a2b8;
}

.current-session {
    color: var(--brand-color);
    font-weight: 500;
    font-size: 0.8125rem;
}

.current-device {
    background-color: var(--brand-color-light);
}

.authorization-info {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.expiry-status {
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.4;
}

.session-info {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.session-time {
    font-size: 0.875rem;
    color: var(--brand-color);
    font-weight: 500;
    line-height: 1.4;
}

.text-success {
    color: #10b981;
}

.text-warning {
    color: #f59e0b;
}

.text-danger {
    color: #ef4444;
}

.text-info {
    color: #3b82f6;
}

.text-muted {
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* Table cell content styling */
.table td {
    font-size: 0.875rem;
    color: var(--text-dark);
    vertical-align: middle;
}

/* Responsive adjustments for device table */
@media (max-width: 768px) {
    .device-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
    
    .device-icon {
        font-size: 1.2em;
    }
    
    .device-details {
        gap: 1px;
    }
    
    .device-type {
        font-size: 0.8em;
    }
}

/* User Selection Modal Styles */
.user-selection-help {
    background-color: var(--brand-color-light);
    border: 1px solid var(--brand-color);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 20px;
}

.user-selection-help p {
    margin: 0 0 8px 0;
    color: var(--text-dark);
}

.user-selection-help p:last-child {
    margin-bottom: 0;
    color: var(--text-muted);
    font-size: 0.9em;
}

.user-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 16px;
}

.user-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    background-color: var(--background-card);
    transition: all 0.2s ease;
}

.user-option:hover {
    border-color: var(--brand-color);
    background-color: var(--brand-color-light);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-icon {
    font-size: 1.5em;
    flex-shrink: 0;
}

.user-details {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.user-name {
    font-weight: 600;
    color: var(--text-dark);
    font-size: 1.1em;
}

.user-description {
    font-size: 0.9em;
    color: var(--text-muted);
}

.user-meta {
    font-size: 0.8em;
    color: var(--text-muted);
    margin-top: 2px;
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}

.user-main-info {
    font-weight: 500;
    color: var(--text-dark);
    margin-bottom: 2px;
}

.user-meta .separator {
    color: var(--text-muted);
    font-size: 0.7em;
}

.user-meta .last-used {
    color: var(--text-muted);
}

.user-meta .created {
    color: var(--text-muted);
}

/* Responsive adjustments for user selection */
@media (max-width: 768px) {
    .user-option {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .user-info {
        width: 100%;
    }
    
    .user-option button {
        width: 100%;
    }
}

/* User Selection Page Styles - Minimalist */
.user-selection-page {
    text-align: center;
    padding: 20px;
}

.user-selection-page h2 {
    color: var(--text-primary);
    margin-bottom: 6px;
    font-size: 20px;
    font-weight: 600;
}

.user-selection-page p {
    color: var(--text-muted);
    margin-bottom: 24px;
    font-size: 14px;
    line-height: 1.4;
}

.user-list-inline {
    max-width: 650px;
    margin: 0 auto 20px auto;
}

.user-option-minimal {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 12px;
    background-color: var(--bg-secondary);
    transition: all 0.15s ease;
    gap: 16px;
}

.clickable-card {
    cursor: pointer;
}

.clickable-card:hover {
    border-color: var(--brand-color);
    background-color: var(--brand-color-light);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(175, 100, 100, 0.25);
}

.user-info-minimal {
    flex: 1;
    text-align: left;
    min-width: 0;
}

.user-name-minimal {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
    font-size: 16px;
    line-height: 1.2;
    word-break: break-word;
    overflow-wrap: break-word;
}

.user-name-minimal .organization-inline {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 400;
    margin-left: 4px;
}

.user-meta-minimal {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.3;
    font-weight: 500;
}

.user-meta-minimal .organization {
    color: var(--text-muted);
    font-weight: 500;
    font-size: 12px;
}

.login-indicator {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: var(--brand-color);
    transition: all 0.15s ease;
    position: relative;
}

.login-arrow {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 8px;
    height: 8px;
    border-right: 2px solid white;
    border-top: 2px solid white;
    transform: translate(calc(-50% - 0.7px), -50%) rotate(45deg);
    box-sizing: border-box;
}


.alternative-options {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

.alternative-options a {
    color: var(--brand-color);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.15s ease;
    padding: 2px 4px;
    border-radius: 4px;
}

.alternative-options a:hover {
    background-color: var(--brand-color-light);
    color: var(--brand-color-hover);
    text-decoration: none;
}

/* Private Mode Warning Styles */
.private-mode-warning {
    text-align: center;
    padding: 40px 20px;
    max-width: 600px;
    margin: 0 auto;
}

.private-mode-warning .warning-icon {
    font-size: 64px;
    color: var(--brand-color);
    margin-bottom: 20px;
}

.private-mode-warning h2 {
    color: var(--text-dark);
    margin-bottom: 20px;
    font-size: 28px;
}

.private-mode-warning .warning-message {
    color: var(--text-dark);
    font-size: 18px;
    font-weight: 500;
    margin-bottom: 15px;
}

.private-mode-warning .warning-explanation {
    color: var(--text-muted);
    font-size: 16px;
    margin-bottom: 25px;
}

.private-mode-warning .warning-actions {
    background-color: var(--brand-color-lighter);
    border-left: 4px solid var(--brand-color);
    padding: 20px;
    margin: 25px 0;
    text-align: left;
    border-radius: 4px;
}

.private-mode-warning .warning-actions p {
    color: var(--text-dark);
    font-weight: 600;
    margin-bottom: 10px;
}

.private-mode-warning .warning-actions ol {
    margin-left: 20px;
    color: var(--text-dark);
}

.private-mode-warning .warning-actions li {
    margin-bottom: 8px;
    line-height: 1.6;
}

.private-mode-warning .help-text {
    margin-top: 20px;
}

.private-mode-warning .help-text p {
    color: var(--text-muted);
    font-size: 14px;
}

/* Setup Options Styles */
.setup-options {
    text-align: center;
    padding: 0;
    display: flex;
    flex-direction: column;
    max-width: 500px;
    margin: 0 auto;
}

.setup-options h2 {
    color: var(--text-primary);
    margin-bottom: 20px;
    font-size: 28px;
}

.setup-options p {
    color: var(--text-muted);
    margin-bottom: 15px;
    font-size: 16px;
}

.setup-intro-text {
    color: var(--text-primary);
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 0;
    margin-top: 0;
    line-height: 1.5;
}

.setup-buttons {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin: 0;
    width: 100%;
}

.setup-buttons .btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 18px 32px;
    font-size: 17px;
    font-weight: 500;
    text-decoration: none;
    border-radius: 10px;
    transition: all 0.2s ease;
    width: 100%;
    text-align: center;
    margin: 0;
}

.setup-option-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 80px;
    width: 100%;
}

.setup-option-card:last-child {
    margin-bottom: 0;
}

.setup-option-subtitle {
    color: var(--text-muted);
    font-size: 14px;
    line-height: 1.2;
    margin: 0;
    margin-bottom: 0 !important;
    padding: 0;
    text-align: center;
    font-style: italic;
    font-weight: 400;
}

.setup-option-text-group {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.setup-option-helper {
    color: var(--text-muted);
    font-size: 12px;
    line-height: 1.2;
    margin-bottom: 0;
    margin-top: 0;
    padding: 0;
    text-align: center;
    font-style: normal;
    font-weight: 400;
    opacity: 0.8;
}

.setup-option-description {
    color: var(--text-muted);
    font-size: 12px;
    line-height: 1.4;
    margin-top: 2px;
    padding: 0 5px;
    text-align: center;
    font-weight: 500;
}

.help-text {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.help-text a {
    color: var(--primary-color);
    text-decoration: none;
}

.help-text a:hover {
    text-decoration: underline;
}

/* Responsive adjustments for minimalist user selection */
@media (max-width: 768px) {
    .user-option-minimal {
        flex-direction: row;
        align-items: center;
        text-align: left;
        padding: 14px 16px;
        gap: 12px;
    }
    
    .user-info-minimal {
        text-align: left;
    }
    
    .login-indicator {
        width: 28px;
        height: 28px;
    }
    
    .login-arrow {
        font-size: 14px;
    }
    
    .user-list-inline {
        max-width: 100%;
    }
    
    .user-selection-page {
        padding: 16px;
    }
}

/* Responsive adjustments for private mode warning */
@media (max-width: 768px) {
    .private-mode-warning {
        padding: 20px 15px;
    }
    
    .private-mode-warning .warning-icon {
        font-size: 48px;
    }
    
    .private-mode-warning h2 {
        font-size: 24px;
    }
    
    .private-mode-warning .warning-message {
        font-size: 16px;
    }
    
    .private-mode-warning .warning-actions {
        padding: 15px;
    }
}

/* Responsive adjustments for setup options */
@media (max-width: 768px) {
    .setup-options {
        padding: 0;
        max-width: 100%;
    }
    
    .auth-header .setup-intro-text {
        font-size: 20px;
        margin-bottom: 1.5rem;
    }
    
    .setup-buttons .btn {
        padding: 16px 24px;
        font-size: 16px;
    }
    
    .setup-buttons .btn i {
        font-size: 18px;
        width: 18px;
    }
    
    .setup-option-card {
        margin-bottom: 64px;
    }
    
    .setup-option-subtitle {
        font-size: 13px;
    }
    
    .setup-option-helper {
        font-size: 11px;
    }
}


/* Enhanced Stat Cards */
.stat-card {
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--brand-color), var(--brand-color-hover));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.stat-card.clickable-stat:hover::before {
    opacity: 1;
}

.stat-icon {
    flex-shrink: 0;
}

/* Spinner element for buttons */
.btn-spinner {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    margin-left: 0.5rem;
    vertical-align: middle;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    pointer-events: none;
}

.loading-spinner {
    display: inline-block;
    width: 1.5rem;
    height: 1.5rem;
    border: 3px solid var(--border-color);
    border-top-color: var(--brand-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.skeleton-loader {
    background: linear-gradient(90deg, var(--background-light) 25%, var(--background-card) 50%, var(--background-light) 75%);
    background-size: 200% 100%;
    animation: loading 1.5s ease-in-out infinite;
    border-radius: 0.25rem;
    min-height: 1rem;
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.skeleton-row {
    display: flex;
    gap: 1rem;
    padding: 0.75rem;
}

.skeleton-cell {
    flex: 1;
    height: 1rem;
}

/* Enhanced Empty States */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-muted);
}

.empty-state h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.empty-state p {
    font-size: 1rem;
    margin-bottom: 1rem;
}

/* Enhanced Modal */
.modal {
    backdrop-filter: blur(4px);
}

.modal-content {
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-body .form-group {
    margin-bottom: 1.25rem;
}

.modal-body .form-group:last-child {
    margin-bottom: 0;
}

/* Search Input with Clear Button */
.search-wrapper {
    position: relative;
    display: inline-block;
}

.search-wrapper input {
    padding-right: 2.5rem;
}

.search-clear {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.25rem;
    font-size: 1.25rem;
    line-height: 1;
    opacity: 0.6;
    transition: opacity 0.2s ease;
}

.search-clear:hover {
    opacity: 1;
}

.search-clear:focus {
    outline: 2px solid var(--brand-color);
    outline-offset: 2px;
    border-radius: 0.25rem;
}

/* Filter Badges */
.filter-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.75rem;
    background-color: var(--brand-color-light);
    color: var(--brand-color);
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 500;
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
}

.filter-badge .filter-remove {
    background: none;
    border: none;
    color: var(--brand-color);
    cursor: pointer;
    padding: 0;
    font-size: 1rem;
    line-height: 1;
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.filter-badge .filter-remove:hover {
    opacity: 1;
}

/* Active Filter Count */
.active-filters {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

/* Tooltips */
.tooltip {
    position: relative;
    display: inline-block;
}

.tooltip .tooltip-text {
    visibility: hidden;
    position: absolute;
    background-color: var(--text-dark);
    color: var(--text-light);
    text-align: center;
    padding: 0.5rem 0.75rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    white-space: nowrap;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    margin-bottom: 0.5rem;
}

.tooltip .tooltip-text::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: var(--text-dark);
}

.tooltip:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
}

/* Confirmation Modal */
.confirm-modal {
    max-width: 400px;
}

.confirm-modal .modal-body {
    text-align: center;
}

.confirm-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.confirm-icon.warning {
    color: #f59e0b;
}

.confirm-icon.danger {
    color: #dc2626;
}

.confirm-message {
    font-size: 1.125rem;
    font-weight: 500;
    color: var(--text-dark);
    margin-bottom: 1rem;
}

.confirm-details {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

.confirm-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

/* Mobile Table Card View */
@media (max-width: 768px) {
    .table-responsive {
        overflow: visible;
    }
    
    .table {
        display: none;
    }
    
    .table-mobile-view {
        display: block;
    }
    
    .mobile-card {
        background: var(--background-card);
        border: 1px solid var(--border-color);
        border-radius: 0.75rem;
        padding: 1rem;
        margin-bottom: 1rem;
        transition: box-shadow 0.2s ease;
    }
    
    .mobile-card:hover {
        box-shadow: 0 2px 8px var(--shadow-color);
    }
    
    .mobile-card-header {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        margin-bottom: 0.75rem;
        padding-bottom: 0.75rem;
        border-bottom: 1px solid var(--border-color);
    }
    
    .mobile-card-title {
        font-weight: 600;
        color: var(--text-dark);
        font-size: 1rem;
    }
    
    .mobile-card-body {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .mobile-card-row {
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
    
    .mobile-card-label {
        font-weight: 500;
        color: var(--text-muted);
        font-size: 0.875rem;
    }
    
    .mobile-card-value {
        color: var(--text-dark);
        font-size: 0.875rem;
        text-align: right;
    }
    
    .mobile-card-actions {
        margin-top: 0.75rem;
        padding-top: 0.75rem;
        border-top: 1px solid var(--border-color);
        display: flex;
        gap: 0.5rem;
        flex-wrap: wrap;
    }
}

@media (min-width: 769px) {
    .table-mobile-view {
        display: none;
    }
}

