/* ===== CSS VARIABLES FOR THEMING ===== */
:root {
  /* Primary colors */
  --color-primary: #4285f4;
  --color-primary-hover: #3367d6;
  --color-primary-light: #357ae8;
  
  /* Success colors */
  --color-success: #34a853;
  --color-success-hover: #2d8e47;
  --color-success-bg: #e8f5e9;
  --color-success-text: #2e7d32;
  
  /* Error/Danger colors */
  --color-error: #ea4335;
  --color-error-bg: #ffebee;
  --color-error-text: #c62828;
  --color-error-dark: #b71c1c;
  --color-error-border: #ef5350;
  
  /* Info colors */
  --color-info: #1976d2;
  --color-info-bg: #e3f2fd;
  --color-info-text: #1565c0;
  
  /* Warning colors */
  --color-warning: #e65100;
  --color-warning-bg: #fff3e0;
  --color-warning-border: #f57c00;
  
  /* Background colors */
  --color-bg-primary: white;
  --color-bg-secondary: #f5f5f5;
  --color-bg-tertiary: #f8f9fa;
  --color-bg-hover: #fafafa;
  
  /* Text colors */
  --color-text-primary: #333;
  --color-text-secondary: #666;
  --color-text-tertiary: #999;
  --color-text-light: #555;
  --color-text-dark: #212529;
  --color-text-muted: #495057;
  
  /* Border colors */
  --color-border-primary: #e0e0e0;
  --color-border-secondary: #ddd;
  --color-border-light: #dee2e6;
  --color-border-dark: #dadce0;
  --color-border-darker: #d2d4d6;
  
  /* Shadow colors */
  --shadow-sm: rgba(0, 0, 0, 0.1);
  --shadow-md: rgba(0, 0, 0, 0.15);
  --shadow-primary: rgba(66, 133, 244, 0.15);
  --shadow-primary-hover: rgba(66, 133, 244, 0.3);
  --shadow-primary-strong: rgba(66, 133, 244, 0.4);
  --shadow-google: rgba(60, 64, 67, 0.3);
  --shadow-google-light: rgba(60, 64, 67, 0.15);
  
  /* Badge colors */
  --color-badge-primary-bg: #e3f2fd;
  --color-badge-primary-text: #1976d2;
  --color-badge-secondary-bg: #f3e5f5;
  --color-badge-secondary-text: #7b1fa2;
  --color-badge-google: #4285f4;
  --color-badge-native: #6c757d;
  --color-badge-role: #17a2b8;
  --color-badge-verified: #28a745;
  --color-badge-unverified: #dc3545;
  
  /* Link colors */
  --color-link: blue;
  --color-link-primary: #4285f4;
  --color-link-hover: #1a73e8;
  --color-link-active: #0d47a1;
  --color-link-light: #71a7ff;
  
  /* Google button colors */
  --color-google-bg: white;
  --color-google-text: #3c4043;
  --color-google-hover: #f8f9fa;
  --color-google-active: #f1f3f4;
  
  /* Action button colors */
  --color-btn-add: #0288d1;
  --color-btn-add-hover: #0277bd;
  --color-btn-add-active: #01579b;
  
  /* Misc colors */
  --color-bullet: #666;
  --color-overlay: rgba(0, 0, 0, 0.05);
  --color-overlay-danger: rgba(234, 67, 53, 0.1);
  --color-overlay-error: #fee;
  
  /* Warn-list colors */
  --color-warnlist-bg: #ffebee;
  --color-warnlist-border: #ffcdd2;
  --color-warnlist-text: #c62828;
}

/* Dark mode theme */
[data-theme="dark"] {
  /* Primary colors - slightly lighter for dark mode */
  --color-primary: #5a9aff;
  --color-primary-hover: #4285f4;
  --color-primary-light: #6ba5ff;
  
  /* Success colors */
  --color-success: #46b865;
  --color-success-hover: #3da857;
  --color-success-bg: #1e3a25;
  --color-success-text: #6fd88a;
  
  /* Error/Danger colors */
  --color-error: #f55449;
  --color-error-bg: #3a1f1e;
  --color-error-text: #ff8a80;
  --color-error-dark: #ff5252;
  --color-error-border: #ff6659;
  
  /* Info colors */
  --color-info: #4dabf7;
  --color-info-bg: #1a2f3d;
  --color-info-text: #74c0fc;
  
  /* Warning colors */
  --color-warning: #ff8c42;
  --color-warning-bg: #3d2a1a;
  --color-warning-border: #ffa94d;
  
  /* Background colors */
  --color-bg-primary: #121212;
  --color-bg-secondary: #1e1e1e;
  --color-bg-tertiary: #2a2a2a;
  --color-bg-hover: #333333;
  
  /* Text colors */
  --color-text-primary: #e0e0e0;
  --color-text-secondary: #b0b0b0;
  --color-text-tertiary: #808080;
  --color-text-light: #c0c0c0;
  --color-text-dark: #f0f0f0;
  --color-text-muted: #a0a0a0;
  
  /* Border colors */
  --color-border-primary: #404040;
  --color-border-secondary: #4a4a4a;
  --color-border-light: #3a3a3a;
  --color-border-dark: #505050;
  --color-border-darker: #555555;
  
  /* Shadow colors */
  --shadow-sm: rgba(0, 0, 0, 0.3);
  --shadow-md: rgba(0, 0, 0, 0.4);
  --shadow-primary: rgba(90, 154, 255, 0.2);
  --shadow-primary-hover: rgba(90, 154, 255, 0.35);
  --shadow-primary-strong: rgba(90, 154, 255, 0.45);
  --shadow-google: rgba(0, 0, 0, 0.4);
  --shadow-google-light: rgba(0, 0, 0, 0.25);
  
  /* Badge colors */
  --color-badge-primary-bg: #1a3a5a;
  --color-badge-primary-text: #74c0fc;
  --color-badge-secondary-bg: #3a2a4a;
  --color-badge-secondary-text: #d0a0ff;
  --color-badge-google: #5a9aff;
  --color-badge-native: #8a9aa7;
  --color-badge-role: #3ac5d8;
  --color-badge-verified: #46b865;
  --color-badge-unverified: #ff6b6b;
  
  /* Link colors */
  --color-link: #6ba5ff;
  --color-link-primary: #5a9aff;
  --color-link-hover: #74c0fc;
  --color-link-active: #91d7ff;
  --color-link-light: #4285f4;
  
  /* Google button colors */
  --color-google-bg: #2a2a2a;
  --color-google-text: #e0e0e0;
  --color-google-hover: #333333;
  --color-google-active: #3a3a3a;
  
  /* Action button colors */
  --color-btn-add: #0288d1;
  --color-btn-add-hover: #0277bd;
  --color-btn-add-active: #01579b;
  
  /* Misc colors */
  --color-bullet: #b0b0b0;
  --color-overlay: rgba(255, 255, 255, 0.05);
  --color-overlay-danger: rgba(255, 107, 107, 0.15);
  --color-overlay-error: #3a1f1e;
  
  /* Warn-list colors */
  --color-warnlist-bg: #3a1f1e;
  --color-warnlist-border: #5a2f2e;
  --color-warnlist-text: #ff8a80;
}

/* ===== GLOBAL STYLES ===== */
body {
  background-color: var(--color-bg-primary);
  color: var(--color-text-primary);
  margin: 0;
  padding: 0;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* ===== CONTAINERS ===== */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
}

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

.page-header h1 {
  margin: 0;
}

@media (max-width: 768px) {
  .page-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }
}

.form-container {
  background: var(--color-bg-secondary);
  border: 2px solid var(--color-primary);
  border-radius: 8px;
  padding: 2rem;
  margin-bottom: 2rem;
  box-shadow: 0 4px 8px var(--shadow-primary);
}

.form-container h2 {
  margin-top: 0;
  margin-bottom: 1.5rem;
  color: var(--color-primary);
}

/* ===== TYPOGRAPHY ===== */
h1 {
  font-size: 2rem;
  margin-bottom: 2rem;
  color: var(--color-text-primary);
}

h2 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
  color: var(--color-text-primary);
}

.description {
  color: var(--color-text-secondary);
  margin-bottom: 1.5rem;
  font-size: 0.95rem;
}

/* ===== FORMS ===== */
.form-group {
  margin-bottom: 1.5rem;
  width: 100%;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: var(--color-text-primary);
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--color-border-secondary);
  border-radius: 4px;
  font-size: 1rem;
  box-sizing: border-box;
  font-family: inherit;
  background: var(--color-bg-primary);
  color: var(--color-text-primary);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px var(--shadow-primary);
}

.form-group textarea {
  resize: vertical;
  min-height: 80px;
}

.form-hint {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.875rem;
  color: var(--color-text-secondary);
  font-style: italic;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

@media (max-width: 768px) {
  .form-row {
    grid-template-columns: 1fr;
  }
}

.form-actions {
  display: flex;
  gap: 1rem;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--color-border-primary);
}

.centered-form {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.centered-form .form-group {
  width: 100%;
  max-width: 400px;
}

.centered-form button[type="submit"] {
  width: 100%;
  max-width: 400px;
  padding: 0.75rem;
  font-size: 1rem;
}

/* ===== MESSAGES ===== */
.error {
  color: var(--color-error);
  font-size: 0.8em;
  margin-top: 0.5em;
}

.success {
  color: var(--color-success);
  font-size: 0.8em;
  margin-top: 0.5em;
}

.error-message {
  background-color: var(--color-error-bg);
  border: 2px solid var(--color-error-border);
  border-radius: 8px;
  padding: 2rem;
  margin-bottom: 2rem;
}

.error-message h2 {
  color: var(--color-error-text);
  margin-bottom: 1rem;
  font-size: 1.5rem;
}

.error-message p {
  color: var(--color-error-dark);
  margin: 0;
  line-height: 1.6;
}

.error-box {
  background-color: var(--color-error-bg);
  color: var(--color-error-text);
  padding: 1rem;
  border-radius: 4px;
  margin-bottom: 1rem;
}

.success-box {
  background-color: var(--color-success-bg);
  color: var(--color-success-text);
  padding: 1rem;
  border-radius: 4px;
  margin-bottom: 1rem;
}

.info-box {
  background-color: var(--color-info-bg);
  color: var(--color-info-text);
  padding: 1rem;
  border-radius: 4px;
  margin-bottom: 1rem;
}

.info-box p {
  margin: 0;
}

.warning-box {
  background-color: var(--color-warning-bg);
  color: var(--color-warning);
  padding: 1rem;
  border-radius: 4px;
  margin-bottom: 1rem;
  border-left: 4px solid var(--color-warning-border);
}

.loading {
  background-color: var(--color-info-bg);
  color: var(--color-info);
  padding: 1rem;
  border-radius: 4px;
  margin-bottom: 1rem;
  text-align: center;
}

.loading p {
  margin: 0;
}

.info-message {
  padding: 2rem;
  text-align: center;
  color: var(--color-text-secondary);
  background-color: var(--color-bg-secondary);
  border-radius: 4px;
}

/* ===== CARDS & TILES ===== */
.card {
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border-primary);
  border-radius: 8px;
  padding: 1.5rem;
  box-shadow: 0 2px 4px var(--shadow-sm);
  transition: box-shadow 0.3s ease;
}

.card:hover {
  box-shadow: 0 4px 8px var(--shadow-md);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--color-border-primary);
}

.card-header h2 {
  margin: 0;
  font-size: 1.5rem;
  color: var(--color-text-primary);
}

.card-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* ===== BADGES ===== */
.badge {
  padding: 0.25rem 0.75rem;
  border-radius: 4px;
  font-size: 0.875rem;
  font-weight: 600;
}

.badge-primary {
  background-color: var(--color-badge-primary-bg);
  color: var(--color-badge-primary-text);
}

.badge-secondary {
  background-color: var(--color-badge-secondary-bg);
  color: var(--color-badge-secondary-text);
}

.badge-success {
  background-color: var(--color-success-bg);
  color: var(--color-success-text);
}

/* ===== DETAIL ROWS ===== */
.detail-section {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.detail-row {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.detail-row .label {
  font-weight: 600;
  color: var(--color-text-secondary);
  font-size: 0.875rem;
}

.detail-row .value {
  color: var(--color-text-primary);
}

/* ===== LISTS ===== */
.simple-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.simple-list li {
  padding: 0.5rem;
  background-color: var(--color-bg-secondary);
  border-radius: 4px;
  font-family: monospace;
  font-size: 0.875rem;
  color: var(--color-text-primary);
}

.badge-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.bullet-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.bullet-list li {
  padding: 0.25rem 0;
}

.bullet-list li:before {
  content: "• ";
  color: var(--color-bullet);
  margin-right: 0.5rem;
}

/* ===== TABLES ===== */
.data-table {
  border: 1px solid var(--color-border-primary);
  border-radius: 4px;
  overflow: hidden;
}

.table-row {
  display: grid;
  grid-template-columns: 200px 1fr;
  border-bottom: 1px solid var(--color-border-primary);
}

.table-row:last-child {
  border-bottom: none;
}

.table-row.header {
  background-color: var(--color-bg-secondary);
  font-weight: 600;
  color: var(--color-text-primary);
}

.table-row:not(.header):hover {
  background-color: var(--color-bg-hover);
}

.table-cell-key {
  padding: 1rem;
  border-right: 1px solid var(--color-border-primary);
  font-weight: 500;
  color: var(--color-text-light);
  word-break: break-word;
}

.table-cell-value {
  padding: 1rem;
  color: var(--color-text-primary);
  word-break: break-word;
  font-family: 'Courier New', monospace;
  font-size: 0.9rem;
}

/* ===== LINKS ===== */
.alink {
  color: var(--color-link);
  text-decoration: underline;
  cursor: pointer;
}

.inactive-link {
  text-decoration: none;
  cursor: default;
}

.client-link {
  color: var(--color-link-primary);
  text-decoration: none;
  cursor: pointer;
}

.client-link:hover {
  text-decoration: underline;
}

.role-link {
  color: var(--color-link-primary);
  text-decoration: none;
  cursor: pointer;
  font-weight: 600;
}

.role-link:hover {
  text-decoration: underline;
}

/* ===== DIVIDER ===== */
.divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 1.5rem 0;
  color: var(--color-text-secondary);
  font-size: 0.875rem;
}

.divider::before,
.divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid var(--color-border-primary);
}

.divider span {
  padding: 0 1rem;
}

/* ===== GOOGLE SIGN-IN BUTTON ===== */
.google-button {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 0.75rem 1.5rem;
  background-color: var(--color-google-bg);
  border: 1px solid var(--color-border-dark);
  border-radius: 4px;
  color: var(--color-google-text);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.google-button:hover:not(:disabled) {
  background-color: var(--color-google-hover);
  border-color: var(--color-border-darker);
  box-shadow: 0 1px 2px 0 var(--shadow-google), 0 1px 3px 1px var(--shadow-google-light);
}

.google-button:active:not(:disabled) {
  background-color: var(--color-google-active);
}

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

.google-button .google-icon {
  width: 18px;
  height: 18px;
}

/* ===== BUTTONS ===== */
button {
  padding: 0.75rem 1.5rem;
  background: var(--color-primary);
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 500;
  transition: background 0.2s ease;
}

button:hover:not(:disabled) {
  background: var(--color-primary-hover);
}

button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

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

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

.btn-secondary {
  padding: 0.75rem 1.5rem;
  background: var(--color-bg-secondary);
  color: var(--color-text-primary);
  border: 1px solid var(--color-border-secondary);
  border-radius: 4px;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 500;
}

.btn-secondary:hover:not(:disabled) {
  background: var(--color-border-primary);
}

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

.btn-add {
  padding: 0.75rem 1.5rem;
  background: var(--color-btn-add);
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 500;
  transition: background 0.2s ease;
}

.btn-add:hover:not(:disabled) {
  background: var(--color-btn-add-hover);
}

.btn-add:active:not(:disabled) {
  background: var(--color-btn-add-active);
}

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

.btn-danger {
  padding: 0.75rem 1.5rem;
  background: var(--color-error);
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 500;
  transition: background 0.2s ease;
}

.btn-danger:hover:not(:disabled) {
  background: var(--color-error-dark);
}

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

.btn-icon {
  padding: 0.5rem;
  background: transparent;
  border: 1px solid var(--color-border-secondary);
  border-radius: 4px;
  cursor: pointer;
  font-size: 1.2rem;
  transition: all 0.2s ease;
}

.btn-icon:hover:not(:disabled) {
  background: var(--color-bg-secondary);
  border-color: var(--color-primary);
}

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

.btn-icon.btn-icon-danger:hover:not(:disabled) {
  background: var(--color-overlay-error);
  border-color: var(--color-error);
}

.card-actions {
  display: flex;
  gap: 0.5rem;
}

.sub-tiles-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.btn-add-small {
  padding: 0.25rem 0.5rem;
  font-size: 0.875rem;
  background: var(--color-primary);
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.2s ease;
}

.btn-add-small:hover:not(:disabled) {
  background: var(--color-primary-light);
}

.btn-add-small:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-icon-danger:hover {
  background: var(--color-overlay-danger);
}

/* ===== ACCOUNT PICTURE ===== */
.account-picture {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
}

/* ===== NOTICE MESSAGES ===== */
.notice-box {
  padding: 1rem;
  border-radius: 8px;
  margin-bottom: 1.5rem;
}

.notice-box p {
  margin: 0.5rem 0;
}

.notice-success {
  background: var(--color-success-bg);
  color: var(--color-success-text);
}

.notice-info {
  background: var(--color-info-bg);
  color: var(--color-info);
}

.notice-warning {
  background: var(--color-warning-bg);
  color: var(--color-warning);
}

/* ===== STANDARD TABLE ===== */
.standard-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--color-bg-secondary);
  box-shadow: 0 2px 4px var(--shadow-sm);
  border-radius: 8px;
  overflow: hidden;
}

.standard-table thead {
  background: var(--color-bg-tertiary);
}

.standard-table thead th {
  padding: 1rem;
  text-align: left;
  font-weight: 600;
  color: var(--color-text-muted);
  border-bottom: 2px solid var(--color-border-light);
}

.standard-table tbody tr {
  border-bottom: 1px solid var(--color-border-light);
}

.standard-table tbody tr:hover {
  background: var(--color-bg-tertiary);
}

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

.standard-table tbody td {
  padding: 1rem;
  color: var(--color-text-dark);
}

.table-cell-flex {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* ===== BADGE VARIANTS ===== */
.badge-google {
  background: var(--color-badge-google);
  color: white;
}

.badge-native {
  background: var(--color-badge-native);
  color: white;
}

.badge-verified {
  color: var(--color-badge-verified);
}

.badge-unverified {
  color: var(--color-badge-unverified);
}

.badge-role {
  background: var(--color-badge-role);
  color: white;
}

/* ===== FILTER SECTION ===== */
.filter-section {
  margin-bottom: 2rem;
  background: var(--color-bg-secondary);
  padding: 1.5rem;
  border: 1px solid var(--color-border-primary);
  border-radius: 8px;
  box-shadow: 0 2px 4px var(--shadow-sm);
}

.filter-input-wrapper {
  position: relative;
  margin-bottom: 0.75rem;
}

.filter-input {
  width: 100%;
  padding: 0.75rem 2.5rem 0.75rem 0.75rem;
  border: 1px solid var(--color-border-secondary);
  border-radius: 4px;
  font-size: 1rem;
  box-sizing: border-box;
  background: var(--color-bg-primary);
  color: var(--color-text-primary);
}

.filter-input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px var(--shadow-primary);
}

.filter-clear-button {
  position: absolute;
  right: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: var(--color-text-tertiary);
  font-size: 1.25rem;
  width: 2rem;
  height: 2rem;
  padding: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s ease;
}

.filter-clear-button:hover {
  background: var(--color-bg-secondary);
  color: var(--color-text-primary);
}

.filter-clear-button:active {
  background: var(--color-border-primary);
}

.filter-info {
  color: var(--color-text-secondary);
  font-size: 0.9rem;
}

/* ===== TILE GRIDS ===== */
.tile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
  gap: 1.5rem;
}

.tile {
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border-primary);
  border-radius: 8px;
  padding: 1.5rem;
  box-shadow: 0 2px 4px var(--shadow-sm);
  transition: all 0.3s ease;
}

.tile:hover {
  box-shadow: 0 4px 12px var(--shadow-md);
  transform: translateY(-2px);
}

.highlighted-tile {
  border: 3px solid var(--color-primary);
  box-shadow: 0 4px 12px var(--shadow-primary-hover);
}

.highlighted-tile:hover {
  box-shadow: 0 6px 16px var(--shadow-primary-strong);
}

.tile-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--color-bg-secondary);
}

.tile-header-actions {
  display: flex;
  flex-wrap: wrap;
}

.tile-identity {
  display: flex;
  gap: 1rem;
  align-items: center;
  flex: 1;
}

.tile-picture {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

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

.tile-title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--color-text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tile-subtitle {
  margin: 0.25rem 0 0 0;
  font-size: 0.9rem;
  color: var(--color-text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tile-badges {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  align-items: flex-end;
  flex-shrink: 0;
}

.tile-details {
  margin-bottom: 1rem;
}

.tile-detail-item {
  display: flex;
  gap: 0.5rem;
  font-size: 0.9rem;
  color: var(--color-text-secondary);
}

.tile-detail-item .label {
  font-weight: 600;
}

.tile-detail-item .value {
  color: var(--color-text-primary);
}

/* ===== SUB-TILES ===== */
.sub-tiles-section {
  margin-top: 1rem;
}

.sub-tiles-title {
  margin: 0 0 0.75rem 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-text-light);
}

.sub-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.75rem;
}

.sub-tile {
  background: var(--color-bg-tertiary);
  padding: 0.75rem;
  border-radius: 4px;
  border-left: 3px solid var(--color-primary);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.sub-tile:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px var(--shadow-md);
}

.sub-tile-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.sub-tile-title {
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.5px;
}

.sub-tile-content {
  font-size: 0.85rem;
  opacity: 0.9;
  word-break: break-word;
}

.sub-tiles-empty {
  color: var(--color-text-tertiary);
  font-style: italic;
  padding: 0.75rem;
  background: var(--color-bg-secondary);
  border-radius: 4px;
  text-align: center;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .table-row {
    grid-template-columns: 1fr;
  }

  .table-cell-key {
    border-right: none;
    border-bottom: 1px solid var(--color-border-primary);
    background-color: var(--color-bg-tertiary);
  }

  .standard-table {
    font-size: 0.875rem;
  }

  .standard-table thead th,
  .standard-table tbody td {
    padding: 0.75rem 0.5rem;
  }

  .account-picture {
    width: 24px;
    height: 24px;
  }
  
  .tile-grid {
    grid-template-columns: 1fr;
  }
  
  .tile-header {
    flex-direction: column;
    gap: 1rem;
  }
  
  .tile-badges {
    align-items: flex-start;
    flex-direction: row;
    flex-wrap: wrap;
  }
  
  .sub-tiles {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .tile-identity {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .tile-picture {
    width: 40px;
    height: 40px;
  }
}

/* ===== MODAL STYLES ===== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;
}

.modal-content {
  background: var(--color-bg-secondary);
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  max-width: 600px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
}

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

.modal-header h2 {
  margin: 0;
  color: var(--color-text-primary);
  font-size: 1.5rem;
}

.modal-body {
  padding: 1.5rem;
}

.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--color-border-primary);
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}

/* ===== ALERT STYLES ===== */
.alert {
  padding: 1rem;
  border-radius: 4px;
  margin-bottom: 1rem;
}

.alert strong {
  display: block;
  margin-bottom: 0.5rem;
}

.alert ul {
  margin: 0.5rem 0 0 1.5rem;
  padding: 0;
}

.alert li {
  margin: 0.25rem 0;
}

.alert-warning {
  background-color: var(--color-warning-bg);
  border: 1px solid var(--color-warning-border);
  color: var(--color-text-primary);
}

.alert-info {
  background-color: var(--color-info-bg);
  border: 1px solid var(--color-info);
  color: var(--color-text-primary);
}

/* ===== WARN-LIST ROW HIGHLIGHTING ===== */
tr.warnlist-match {
  background-color: var(--color-warnlist-bg) !important;
  border-left: 3px solid var(--color-warnlist-border);
}

tr.warnlist-match:hover {
  background-color: var(--color-warnlist-bg) !important;
  opacity: 0.9;
}

.footer {
  font-size: small;
  font-style: italic;
  color: var(--color-text-secondary);
  text-align: center;
}

.footer a {
  color: var(--color-text-secondary);
}
