@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600&display=swap');

:root {
  --google-blue: #1a73e8;
  --google-blue-hover: #1557b0;
  --google-blue-light: #e8f0fe;
  --google-red: #d93025;
  --google-yellow: #fbbc05;
  --google-green: #188038;
  
  --text-primary: #202124;
  --text-secondary: #5f6368;
  
  --border-color: #dadce0;
  --border-focus: #1a73e8;
  --border-error: #d93025;
  
  --bg-primary: #ffffff;
  --bg-input: #ffffff;
  
  --font-family: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --transition-speed: 0.15s;
  --transition-bezier: cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ==========================================================================
   1. LOGIN PAGE STYLING
   ========================================================================== */

/* Main Container */
.login-container {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 100%;
  flex-grow: 1;
  padding: 20px;
}

/* Login Card */
.login-card {
  width: 100%;
  max-width: 450px;
  background-color: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 40px;
  display: flex;
  flex-direction: column;
  transition: border-color 0.2s ease;
}

/* Logo Styling */
.logo-container {
  display: flex;
  justify-content: center;
  margin-bottom: 16px;
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.5px;
  user-select: none;
}

.logo-g-blue { color: var(--google-blue); }
.logo-g-red { color: #ea4335; }
.logo-g-yellow { color: var(--google-yellow); }
.logo-g-green { color: #34a853; }

/* Header Text */
.login-header {
  text-align: center;
  margin-bottom: 26px;
}

.login-title {
  font-size: 24px;
  font-weight: 400;
  color: var(--text-primary);
  line-height: 32px;
}

.login-subtitle {
  font-size: 16px;
  font-weight: 400;
  color: var(--text-primary);
  margin-top: 8px;
}

.login-domain {
  font-size: 14px;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* Form Styles */
.login-form {
  display: flex;
  flex-direction: column;
}

/* Input Group with Floating Label */
.input-group {
  position: relative;
  margin-bottom: 20px;
  width: 100%;
}

.input-field {
  width: 100%;
  height: 56px;
  padding: 16px;
  font-size: 16px;
  font-family: var(--font-family);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  outline: none;
  background-color: transparent;
  color: var(--text-primary);
  transition: border-color var(--transition-speed) var(--transition-bezier),
              border-width var(--transition-speed) var(--transition-bezier);
}

#password-group .input-field {
  padding-right: 56px;
}

#password-group .input-field:focus,
#password-group.has-error .input-field {
  padding-right: 55px;
}

.input-label {
  position: absolute;
  left: 16px;
  top: 18px;
  font-size: 16px;
  color: var(--text-secondary);
  pointer-events: none;
  background-color: var(--bg-primary);
  padding: 0 4px;
  transition: transform var(--transition-speed) var(--transition-bezier),
              color var(--transition-speed) var(--transition-bezier),
              font-size var(--transition-speed) var(--transition-bezier);
  transform-origin: left top;
}

/* Floating behavior when active or focused */
.input-field:focus {
  border: 2px solid var(--border-focus);
  padding: 15px; /* Adjusting padding to avoid jump due to border-width */
}

.input-field:focus ~ .input-label,
.input-field:not(:placeholder-shown) ~ .input-label,
.input-group.has-value .input-label {
  transform: translateY(-27px) scale(0.75);
  color: var(--border-focus);
  font-weight: 500;
}

/* Error State */
.input-group.has-error .input-field {
  border: 2px solid var(--border-error);
  padding: 15px;
}

.input-group.has-error .input-field:focus ~ .input-label,
.input-group.has-error .input-field:not(:placeholder-shown) ~ .input-label,
.input-group.has-error .input-label {
  color: var(--border-error);
}

.error-message {
  display: flex;
  align-items: center;
  color: var(--google-red);
  font-size: 12px;
  margin-top: 4px;
  min-height: 18px;
}

.error-icon {
  margin-right: 8px;
  display: flex;
  align-items: center;
}

/* Password Toggle Eye Button */
.password-toggle-btn {
  position: absolute;
  right: 12px;
  top: 10px;
  width: 36px;
  height: 36px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-secondary);
  padding: 0;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s;
  outline: none;
}

.password-toggle-btn svg {
  width: 22px;
  height: 22px;
  display: block;
  flex: 0 0 auto;
}

.password-toggle-btn:hover {
  background-color: #f1f3f4;
}

.password-toggle-btn:focus-visible {
  box-shadow: 0 0 0 2px var(--google-blue);
}

/* Form Helper Links (Forgot Email, etc) */
.form-helper {
  display: flex;
  margin-bottom: 28px;
}

.link-button {
  background: none;
  border: none;
  color: var(--google-blue);
  font-family: var(--font-family);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  outline: none;
  transition: color 0.2s;
}

.link-button:hover, .link-button:focus {
  color: var(--google-blue-hover);
  text-decoration: underline;
}

/* Button & Action Container */
.action-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.create-account-btn {
  font-weight: 500;
  font-size: 14px;
  color: var(--google-blue);
  background: none;
  border: none;
  cursor: pointer;
  padding: 10px 8px;
  border-radius: 4px;
  transition: background-color 0.2s;
}

.create-account-btn:hover {
  background-color: var(--google-blue-light);
}

.primary-button {
  background-color: var(--google-blue);
  color: #ffffff;
  border: none;
  border-radius: 4px;
  height: 40px;
  padding: 0 24px;
  font-family: var(--font-family);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s, box-shadow 0.2s;
  outline: none;
}

.primary-button:hover {
  background-color: var(--google-blue-hover);
  box-shadow: 0 1px 2px 0 rgba(60,64,67,0.3), 0 1px 3px 1px rgba(60,64,67,0.15);
}

.primary-button:focus {
  background-color: var(--google-blue-hover);
  box-shadow: 0 0 0 2px #ffffff, 0 0 0 4px var(--google-blue);
}

.primary-button:disabled {
  background-color: #dadce0;
  color: #80868b;
  cursor: not-allowed;
  box-shadow: none;
}

/* Footer Section */
.footer {
  width: 100%;
  max-width: 450px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 24px;
  padding: 0 10px;
  font-size: 12px;
  color: var(--text-secondary);
}

.language-selector {
  display: flex;
  align-items: center;
  cursor: pointer;
  position: relative;
  padding: 8px 0;
}

.language-selector select {
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 12px;
  font-family: var(--font-family);
  cursor: pointer;
  outline: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  padding-right: 14px;
}

.language-selector::after {
  content: "▾";
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  font-size: 8px;
}

.footer-links {
  display: flex;
  gap: 16px;
}

.footer-link {
  color: var(--text-secondary);
  text-decoration: none;
  padding: 8px;
  border-radius: 4px;
  transition: background-color 0.2s, color 0.2s;
}

.footer-link:hover {
  background-color: #f1f3f4;
  color: var(--text-primary);
}

/* Loading overlay for premium animation */
.loader-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(255, 255, 255, 0.85);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.loader-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.google-spinner {
  display: inline-block;
  width: 48px;
  height: 48px;
  border: 4px solid var(--google-blue-light);
  border-radius: 50%;
  border-top-color: var(--google-blue);
  animation: spin 1s ease-in-out infinite;
}

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

/* ==========================================================================
   2. DASHBOARD WORKSPACE STYLING
   ========================================================================== */

.dashboard-body {
  display: flex;
  flex-direction: column;
  width: 100%;
  min-height: 100vh;
  justify-content: flex-start;
  align-items: stretch;
  background-color: #ffffff;
}

/* Dashboard Header */
.db-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 64px;
  padding: 0 20px;
  border-bottom: 1px solid var(--border-color);
  background-color: #ffffff;
  position: sticky;
  top: 0;
  z-index: 100;
}

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

.menu-toggle-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  outline: none;
  transition: background-color 0.2s;
}

.menu-toggle-btn:hover {
  background-color: #f1f3f4;
  color: var(--text-primary);
}

.db-logo {
  font-size: 20px;
  font-weight: 500;
  letter-spacing: -0.3px;
  user-select: none;
}

.db-header-center {
  flex-grow: 1;
  max-width: 720px;
  margin: 0 24px;
}

.search-bar {
  display: flex;
  align-items: center;
  background-color: #f1f3f4;
  height: 48px;
  border-radius: 8px;
  padding: 0 16px;
  gap: 12px;
  transition: background-color 0.2s, box-shadow 0.2s;
}

.search-bar:focus-within {
  background-color: #ffffff;
  box-shadow: 0 1px 1px 0 rgba(65,69,73,0.3), 0 1px 3px 1px rgba(65,69,73,0.15);
}

.search-icon {
  color: var(--text-secondary);
  display: flex;
  align-items: center;
}

.search-bar input {
  border: none;
  background: transparent;
  outline: none;
  width: 100%;
  font-size: 16px;
  font-family: var(--font-family);
  color: var(--text-primary);
}

.db-header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.icon-btn {
  position: relative;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-secondary);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s;
  outline: none;
}

.icon-btn:hover {
  background-color: #f1f3f4;
  color: var(--text-primary);
}

.notification-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 8px;
  height: 8px;
  background-color: var(--google-red);
  border-radius: 50%;
}

/* User Avatar and Dropdown */
.user-profile-menu {
  position: relative;
}

.user-avatar {
  width: 32px;
  height: 32px;
  background-color: var(--google-blue);
  color: #ffffff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 500;
  font-size: 14px;
  cursor: pointer;
  user-select: none;
  transition: box-shadow 0.2s;
}

.user-avatar:hover {
  box-shadow: 0 0 0 4px #e8f0fe;
}

.profile-dropdown {
  position: absolute;
  right: 0;
  top: 44px;
  width: 320px;
  background-color: #ffffff;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  box-shadow: 0 1px 3px 0 rgba(60,64,67,0.3), 0 4px 8px 3px rgba(60,64,67,0.15);
  padding: 16px 0;
  display: flex;
  flex-direction: column;
  opacity: 0;
  transform: translateY(-10px);
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 200;
}

.profile-dropdown.active {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.dropdown-header {
  display: flex;
  align-items: center;
  padding: 8px 20px 16px 20px;
  gap: 16px;
}

.large-avatar {
  width: 48px;
  height: 48px;
  background-color: var(--google-blue);
  color: #ffffff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 500;
}

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

.user-name {
  font-weight: 500;
  font-size: 16px;
  color: var(--text-primary);
}

.user-email {
  font-size: 13px;
  color: var(--text-secondary);
}

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

.dropdown-item {
  display: flex;
  align-items: center;
  padding: 12px 20px;
  color: var(--text-primary);
  font-size: 14px;
  text-decoration: none;
  gap: 12px;
  transition: background-color 0.2s;
}

.dropdown-item svg {
  color: var(--text-secondary);
}

.dropdown-item:hover {
  background-color: #f1f3f4;
}

.logout-link {
  color: var(--google-red);
}

.logout-link svg {
  color: var(--google-red);
}

/* Workspace Wrapper */
.db-wrapper {
  display: flex;
  flex-grow: 1;
  width: 100%;
}

/* Sidebar Navigation */
.db-sidebar {
  width: 256px;
  border-right: 1px solid var(--border-color);
  background-color: #ffffff;
  padding-top: 12px;
  flex-shrink: 0;
  transition: width 0.25s var(--transition-bezier);
  overflow-x: hidden;
}

.db-sidebar.collapsed {
  width: 72px;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
}

.nav-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  padding-right: 12px;
  gap: 4px;
}

.nav-item {
  width: 100%;
}

.nav-link {
  display: flex;
  align-items: center;
  height: 48px;
  padding-left: 24px;
  color: var(--text-primary);
  text-decoration: none;
  font-weight: 500;
  font-size: 14px;
  gap: 20px;
  border-radius: 0 24px 24px 0;
  transition: background-color 0.2s, color 0.2s;
  white-space: nowrap;
}

.nav-link svg {
  color: var(--text-secondary);
  flex-shrink: 0;
}

.nav-link:hover {
  background-color: #f1f3f4;
}

.nav-item.active .nav-link {
  background-color: var(--google-blue-light);
  color: var(--google-blue);
}

.nav-item.active .nav-link svg {
  color: var(--google-blue);
}

.sidebar-divider {
  height: 1px;
  background-color: var(--border-color);
  margin: 12px 0 12px 24px;
}

/* Hide span on sidebar collapsed */
.db-sidebar.collapsed .nav-link span {
  opacity: 0;
  pointer-events: none;
}

.db-sidebar.collapsed .sidebar-divider {
  margin-left: 12px;
  margin-right: 12px;
}

/* Main Content Panel */
.db-content {
  flex-grow: 1;
  background-color: #ffffff;
  padding: 32px 40px;
  overflow-y: auto;
  transition: margin-left 0.25s var(--transition-bezier);
}

.db-title-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 28px;
}

.db-page-title {
  font-size: 28px;
  font-weight: 400;
  color: var(--text-primary);
}

.db-page-subtitle {
  font-size: 14px;
  color: var(--text-secondary);
  margin-top: 4px;
}

.add-item-btn {
  height: 44px;
  font-size: 14px;
  border-radius: 22px;
}

/* Metric Cards */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}

.metric-card {
  background-color: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  transition: box-shadow 0.2s;
}

.metric-card:hover {
  box-shadow: 0 1px 2px 0 rgba(60,64,67,0.3), 0 1px 3px 1px rgba(60,64,67,0.15);
}

/* Left colored borders for Google Theme accents */
.metric-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
}

.card-blue::before { background-color: var(--google-blue); }
.card-red::before { background-color: var(--google-red); }
.card-green::before { background-color: var(--google-green); }
.card-yellow::before { background-color: var(--google-yellow); }

.card-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.card-value {
  font-size: 32px;
  font-weight: 400;
  color: var(--text-primary);
  margin-bottom: 12px;
  line-height: 1;
}

.card-footer {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
}

.card-footer svg {
  flex-shrink: 0;
}

.text-green { color: var(--google-green); }
.text-red { color: var(--google-red); }
.text-yellow { color: #b06000; } /* Slightly darker yellow for readability */

/* Split Section Layout */
.db-layout-split {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
  align-items: start;
}

.data-table-section, .system-alerts-section {
  background-color: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 24px;
}

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

.section-header h3 {
  font-size: 18px;
  font-weight: 500;
  color: var(--text-primary);
}

/* Data Table Styling */
.table-container {
  width: 100%;
  overflow-x: auto;
}

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

.db-table th {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
  font-weight: 500;
  font-size: 13px;
  color: var(--text-secondary);
}

.db-table td {
  padding: 16px;
  border-bottom: 1px solid #f1f3f4;
  font-size: 14px;
  color: var(--text-primary);
}

.db-table tbody tr:hover {
  background-color: #f8f9fa;
}

.font-medium {
  font-weight: 500;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
}

.badge-success {
  background-color: #e6f4ea;
  color: var(--google-green);
}

.badge-warning {
  background-color: #fef7e0;
  color: #b06000;
}

.badge-danger {
  background-color: #fce8e6;
  color: var(--google-red);
}

.badge-blue {
  background-color: #e8f0fe;
  color: var(--google-blue);
}

.badge-green {
  background-color: #e6f4ea;
  color: var(--google-green);
}

.action-menu-btn {
  background: none;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  padding: 4px 12px;
  font-family: var(--font-family);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s;
  outline: none;
}

.action-menu-btn:hover {
  background-color: #f1f3f4;
  color: var(--text-primary);
  border-color: #80868b;
}

.view-details-btn {
  min-width: 64px;
  color: var(--google-blue);
  border-color: rgba(26, 115, 232, 0.35);
  background-color: var(--google-blue-light);
}

.view-details-btn:hover {
  color: var(--google-blue);
  border-color: var(--google-blue);
  background-color: #d2e3fc;
}

.danger-action-btn {
  border: 1px solid transparent;
  border-radius: 6px;
  font-family: var(--font-family);
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  transition: background-color 0.2s, border-color 0.2s, color 0.2s, box-shadow 0.2s;
  outline: none;
  white-space: nowrap;
}

.danger-action-btn-solid {
  min-width: 168px;
  height: 44px;
  padding: 0 24px;
  border-radius: 22px;
  background-color: var(--google-red);
  border-color: var(--google-red);
  color: #ffffff;
  box-shadow: 0 1px 2px rgba(217, 48, 37, 0.24);
}

.danger-action-btn-solid:hover:not(:disabled),
.danger-action-btn-solid:focus:not(:disabled) {
  background-color: #b3261e;
  border-color: #b3261e;
  box-shadow: 0 2px 6px rgba(217, 48, 37, 0.3);
}

.danger-action-btn-solid:disabled {
  background-color: #f1f3f4;
  border-color: #dadce0;
  color: #9aa0a6;
  box-shadow: none;
  cursor: not-allowed;
}

.danger-action-btn-outline {
  min-width: 76px;
  height: 34px;
  padding: 0 14px;
  background-color: #ffffff;
  border-color: #f4c7c3;
  color: var(--google-red);
}

.danger-action-btn-outline:hover,
.danger-action-btn-outline:focus {
  background-color: #fce8e6;
  border-color: var(--google-red);
  color: #b3261e;
}

/* Console Utilities (Right Panel) */
.utility-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.utility-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px;
  border: 1px solid #f1f3f4;
  border-radius: 8px;
  transition: background-color 0.2s;
}

.utility-card:hover {
  background-color: #f8f9fa;
}

.utility-icon {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.icon-blue { background-color: var(--google-blue-light); color: var(--google-blue); }
.icon-red { background-color: #fce8e6; color: var(--google-red); }
.icon-green { background-color: #e6f4ea; color: var(--google-green); }

.utility-details {
  flex-grow: 1;
}

.utility-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
}

.utility-desc {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.utility-action-btn {
  background: none;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  padding: 6px 12px;
  font-family: var(--font-family);
  font-size: 12px;
  font-weight: 500;
  color: var(--google-blue);
  cursor: pointer;
  transition: all 0.2s;
  outline: none;
  white-space: nowrap;
}

.utility-action-btn:hover {
  background-color: var(--google-blue-light);
  border-color: var(--google-blue);
}

.utility-action-btn.btn-danger {
  color: var(--google-red);
}

.utility-action-btn.btn-danger:hover {
  background-color: #fce8e6;
  border-color: var(--google-red);
}

.utility-action-btn:disabled {
  color: var(--text-secondary);
  background-color: #f1f3f4;
  border-color: var(--border-color);
  cursor: not-allowed;
}

/* ==========================================================================
   3. GENERAL RESPONSIVENESS AND COLLAPSIBLE ADAPTATIONS
   ========================================================================== */

@media (max-width: 1024px) {
  .db-layout-split {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .db-sidebar {
    position: fixed;
    top: 64px;
    bottom: 0;
    left: -256px;
    z-index: 90;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
  }
  
  .db-sidebar.collapsed {
    left: 0;
    width: 256px; /* Do not collapse on mobile when opened */
  }
  
  .db-sidebar.collapsed .nav-link span {
    opacity: 1;
    pointer-events: auto;
  }
  
  .db-content {
    padding: 20px;
  }
  
  .db-header-center {
    display: none; /* Hide search bar on mobile screens to save space */
  }
}

@media (max-width: 450px) {
  .login-card {
    border: none;
    padding: 24px 16px;
  }
  
  .footer {
    flex-direction: column;
    gap: 16px;
    align-items: flex-start;
    padding: 0 16px;
  }
  
  .footer-links {
    width: 100%;
    justify-content: flex-start;
    gap: 8px;
  }
  
  .db-title-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }
  
  .add-item-btn {
    width: 100%;
  }
}

/* ==========================================================================
   4. MODALS AND ADVANCED BADGES
   ========================================================================== */

/* Role badge in header */
.role-badge {
  background-color: var(--google-blue-light);
  color: var(--google-blue);
  padding: 6px 12px;
  border-radius: 16px;
  font-size: 13px;
  font-weight: 500;
  border: 1px solid rgba(26, 115, 232, 0.15);
}

/* Modals backdrop & layout */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(32, 33, 36, 0.6);
  z-index: 1000;
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.modal-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  width: 100%;
  max-width: 650px;
  background-color: #ffffff;
  border-radius: 8px;
  box-shadow: 0 1px 3px 0 rgba(60, 64, 67, 0.3), 0 4px 8px 3px rgba(60, 64, 67, 0.15);
  display: flex;
  flex-direction: column;
  padding: 24px;
  max-height: 90vh;
  overflow-y: auto;
  transform: translateY(-20px);
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-backdrop.active .modal-card {
  transform: translateY(0);
}

.task-details-card {
  max-width: 720px;
}

.task-details-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.task-detail-block {
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 12px;
  background-color: #f8f9fa;
}

.task-detail-block:nth-child(3),
.task-detail-block:nth-child(4),
.task-detail-block:nth-child(5),
.task-detail-block:nth-child(6),
.task-detail-block:last-child {
  grid-column: 1 / -1;
}

.task-detail-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  margin-bottom: 6px;
}

.task-detail-value {
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

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

.modal-header h3 {
  font-size: 20px;
  font-weight: 500;
  color: var(--text-primary);
}

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

.form-field-group {
  display: flex;
  flex-direction: column;
  margin-bottom: 16px;
}

.form-field-group label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.form-field-group input[type="text"],
.form-field-group input[type="url"],
.form-field-group input[type="date"],
.form-field-group input[type="password"],
.form-field-group select,
.form-field-group textarea {
  height: 44px;
  padding: 10px 14px;
  border-radius: 4px;
  border: 1px solid var(--border-color);
  font-family: var(--font-family);
  font-size: 14px;
  outline: none;
  background-color: #ffffff;
  color: var(--text-primary);
  transition: border-color 0.15s;
}

.form-field-group textarea {
  height: auto;
  resize: vertical;
}

.form-field-group input:focus,
.form-field-group select:focus,
.form-field-group textarea:focus {
  border: 2px solid var(--google-blue);
  padding: 9px 13px; /* Adjust padding to prevent size jump */
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
  margin-top: 24px;
  border-top: 1px solid var(--border-color);
  padding-top: 16px;
}

.create-account-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background-color: transparent !important;
}
