/* ============================================
   FT TANK DIGITAL LOGBOOKS - PROFESSIONAL CSS
   Enterprise Blue Theme
   ============================================ */

/* ============================================
   GLOBAL RESET & BASE STYLES
   ============================================ */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: linear-gradient(135deg, #0066CC 0%, #004999 100%);
  min-height: 100vh;
  color: #2c3e50;
  line-height: 1.6;
}

#app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ============================================
   HEADER
   ============================================ */

.header {
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(10px);
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 2rem;
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 0;
}

.logo {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.logo-icon {
  width: 50px;
  height: 50px;
  background: linear-gradient(135deg, #0066CC 0%, #004999 100%);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  font-weight: 800;
  font-size: 1.2rem;
  box-shadow: 0 4px 12px rgba(0, 102, 204, 0.25);
  letter-spacing: 1px;
}

.logo h1 {
  font-size: 1.4rem;
  color: #2c3e50;
  margin: 0;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.subtitle {
  font-size: 0.85rem;
  color: #7f8c8d;
  margin-top: 0.15rem;
  font-weight: 400;
}

.header-stats {
  display: flex;
  gap: 2.5rem;
}

.stat-item {
  text-align: center;
}

.stat-value {
  font-size: 1.75rem;
  font-weight: 700;
  color: #0066CC;
  line-height: 1.2;
}

.stat-label {
  font-size: 0.8rem;
  color: #7f8c8d;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
  margin-top: 0.25rem;
}

/* ============================================
   NAVIGATION TABS
   ============================================ */

.tabs {
  background: rgba(255, 255, 255, 0.95);
  border-bottom: 2px solid #e0e0e0;
  display: flex;
  overflow-x: auto;
  gap: 0.25rem;
  padding: 0.5rem 2rem;
  position: sticky;
  top: 90px;
  z-index: 99;
  backdrop-filter: blur(10px);
}

.tabs::-webkit-scrollbar {
  height: 4px;
}

.tabs::-webkit-scrollbar-thumb {
  background: #0066CC;
  border-radius: 2px;
}

.tab {
  padding: 0.75rem 1.5rem;
  background: transparent;
  border: none;
  color: #6c757d;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.2s ease;
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  position: relative;
}

.tab::after {
  content: '';
  position: absolute;
  bottom: -0.5rem;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 2px;
  background: #0066CC;
  transition: width 0.2s ease;
}

.tab:hover {
  background: rgba(0, 102, 204, 0.05);
  color: #0066CC;
}

.tab.active {
  background: #0066CC;
  color: white;
  box-shadow: 0 2px 8px rgba(0, 102, 204, 0.25);
}

.tab.active::after {
  width: 80%;
}

/* ============================================
   MAIN CONTENT
   ============================================ */

.main-content {
  flex: 1;
  padding: 2rem;
}

.tab-content {
  animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
  from { 
    opacity: 0; 
    transform: translateY(10px); 
  }
  to { 
    opacity: 1; 
    transform: translateY(0); 
  }
}

/* ============================================
   CARDS
   ============================================ */

.card {
  background: white;
  border-radius: 8px;
  padding: 2rem;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  margin-bottom: 2rem;
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.card h2 {
  margin: 0 0 1.5rem 0;
  font-size: 1.4rem;
  color: #2c3e50;
  font-weight: 700;
  letter-spacing: -0.3px;
}

.card h3 {
  margin: 1.5rem 0 1rem 0;
  font-size: 1.1rem;
  color: #2c3e50;
  font-weight: 600;
}

/* ============================================
   AI AGENT CHAT
   ============================================ */

.agent-container {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 280px);
  background: white;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.12);
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.agent-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 1.5rem;
  background: linear-gradient(135deg, #0066CC 0%, #004999 100%);
  color: white;
  border-bottom: 2px solid rgba(255, 255, 255, 0.1);
}

.agent-header h2 {
  margin: 0;
  font-size: 1.2rem;
  color: white;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.agent-chat-container {
  flex: 1;
  overflow-y: auto;
  padding: 2rem;
  background: #f8f9fa;
}

.agent-chat-container::-webkit-scrollbar {
  width: 8px;
}

.agent-chat-container::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 4px;
}

.agent-chat-container::-webkit-scrollbar-thumb {
  background: #0066CC;
  border-radius: 4px;
}

.agent-chat-container::-webkit-scrollbar-thumb:hover {
  background: #004999;
}

.agent-message {
  margin-bottom: 1.5rem;
  animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
  from { 
    opacity: 0; 
    transform: translateY(20px); 
  }
  to { 
    opacity: 1; 
    transform: translateY(0); 
  }
}

.message-content {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.agent-message-user .message-content {
  flex-direction: row-reverse;
}

.message-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.user-avatar {
  background: linear-gradient(135deg, #0066CC 0%, #004999 100%);
}

.assistant-avatar {
  background: linear-gradient(135deg, #66B2FF 0%, #3399FF 100%);
}

.error-avatar {
  background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
}

.message-bubble {
  max-width: 65%;
  padding: 1rem 1.25rem;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  position: relative;
}

.user-bubble {
  background: linear-gradient(135deg, #0066CC 0%, #004999 100%);
  color: white;
  border-bottom-right-radius: 4px;
}

.assistant-bubble {
  background: white;
  color: #2c3e50;
  border: 1px solid #e0e0e0;
  border-bottom-left-radius: 4px;
}

.error-bubble {
  background: #fff3cd;
  color: #856404;
  border: 1px solid #ffeaa7;
  border-bottom-left-radius: 4px;
}

.message-text {
  font-size: 0.95rem;
  line-height: 1.6;
  word-wrap: break-word;
  white-space: pre-line;
}

.user-bubble .message-text {
  color: white;
}

.tools-used {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(0, 0, 0, 0.1);
  font-size: 0.8rem;
  color: #6c757d;
}

.user-bubble .tools-used {
  border-top-color: rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 0.9);
}

.message-time {
  font-size: 0.75rem;
  margin-top: 0.5rem;
  opacity: 0.7;
}

.user-bubble .message-time {
  text-align: right;
  color: rgba(255, 255, 255, 0.9);
}

.assistant-bubble .message-time {
  color: #95a5a6;
}

/* Typing Indicator */
.typing-indicator {
  display: flex;
  gap: 4px;
  padding: 0.5rem 0;
}

.typing-indicator span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #0066CC;
  animation: bounce 1.4s infinite;
}

.typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.4s; }

@keyframes bounce {
  0%, 60%, 100% { 
    transform: translateY(0); 
    opacity: 0.7;
  }
  30% { 
    transform: translateY(-10px); 
    opacity: 1;
  }
}

/* Agent Input */
.agent-input-container {
  display: flex;
  gap: 1rem;
  padding: 1.5rem;
  background: white;
  border-top: 2px solid #e0e0e0;
}

.agent-input {
  flex: 1;
  padding: 1rem 1.5rem;
  border: 2px solid #d0d0d0;
  border-radius: 4px;
  font-size: 0.95rem;
  outline: none;
  transition: all 0.2s ease;
  background: white;
  font-family: inherit;
}

.agent-input:hover {
  border-color: #b0b0b0;
}

.agent-input:focus {
  border-color: #0066CC;
  box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

.agent-input:disabled {
  background: #f5f5f5;
  cursor: not-allowed;
  border-color: #e0e0e0;
}

.agent-send-btn {
  padding: 1rem 2rem;
  border-radius: 4px;
  font-weight: 600;
  background: #0066CC;
  color: white;
  border: 1px solid #0055AA;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 6px rgba(0, 102, 204, 0.25);
  cursor: pointer;
  transition: all 0.2s ease;
}

.agent-send-btn:hover:not(:disabled) {
  background: #0055AA;
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(0, 102, 204, 0.35);
}

.agent-send-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* Suggestions */
.agent-suggestions {
  padding: 1rem 1.5rem;
  background: white;
  border-top: 1px solid #e0e0e0;
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  align-items: center;
}

.agent-suggestions small {
  color: #6c757d;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  font-size: 0.75rem;
}

.suggestion-chip {
  padding: 0.5rem 1.25rem;
  background: white;
  color: #0066CC;
  border: 2px solid #0066CC;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  letter-spacing: 0.2px;
}

.suggestion-chip:hover {
  background: #0066CC;
  color: white;
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(0, 102, 204, 0.3);
}

/* ============================================
   PROFESSIONAL BUTTONS
   ============================================ */

.btn {
  padding: 0.75rem 1.75rem;
  border: none;
  border-radius: 4px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  font-family: inherit;
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.1);
  transition: left 0.3s ease;
}

.btn:hover::before {
  left: 100%;
}

.btn-primary {
  background: #0066CC;
  color: white;
  box-shadow: 0 2px 4px rgba(0, 102, 204, 0.2);
  border: 1px solid #0055AA;
}

.btn-primary:hover:not(:disabled) {
  background: #0055AA;
  box-shadow: 0 4px 8px rgba(0, 102, 204, 0.3);
  transform: translateY(-1px);
}

.btn-primary:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: 0 1px 2px rgba(0, 102, 204, 0.2);
}

.btn-secondary {
  background: white;
  color: #2c3e50;
  border: 2px solid #d0d0d0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.btn-secondary:hover:not(:disabled) {
  background: #f8f9fa;
  border-color: #0066CC;
  color: #0066CC;
  box-shadow: 0 2px 6px rgba(0, 102, 204, 0.15);
}

.btn-success {
  background: #28a745;
  color: white;
  box-shadow: 0 2px 4px rgba(40, 167, 69, 0.2);
  border: 1px solid #218838;
}

.btn-success:hover:not(:disabled) {
  background: #218838;
  box-shadow: 0 4px 8px rgba(40, 167, 69, 0.3);
  transform: translateY(-1px);
}

.btn-danger {
  background: #dc3545;
  color: white;
  box-shadow: 0 2px 4px rgba(220, 53, 69, 0.2);
  border: 1px solid #c82333;
}

.btn-danger:hover:not(:disabled) {
  background: #c82333;
  box-shadow: 0 4px 8px rgba(220, 53, 69, 0.3);
  transform: translateY(-1px);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

.btn-sm {
  padding: 0.5rem 1.25rem;
  font-size: 0.8rem;
  letter-spacing: 0.2px;
}

.btn-large {
  padding: 1rem 2.5rem;
  font-size: 1rem;
  letter-spacing: 0.5px;
}

.button-group {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.btn:focus-visible {
  outline: 2px solid #0066CC;
  outline-offset: 2px;
}

.btn-close {
  background: rgba(255, 255, 255, 0.2);
  color: white;
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 4px;
  font-size: 1.5rem;
  cursor: pointer;
  transition: all 0.2s ease;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-close:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* Edit Buttons */
.edit-btn {
  padding: 0.35rem 0.75rem;
  font-size: 0.75rem;
  background: transparent;
  color: #0066CC;
  border: 1px solid #0066CC;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  font-weight: 600;
}

.edit-btn:hover {
  background: #0066CC;
  color: white;
}

.edit-save-btn {
  padding: 0.4rem 1rem;
  background: #28a745;
  color: white;
  border: 1px solid #218838;
  border-radius: 4px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.edit-save-btn:hover {
  background: #218838;
  box-shadow: 0 2px 6px rgba(40, 167, 69, 0.3);
}

.edit-cancel-btn {
  padding: 0.4rem 1rem;
  background: white;
  color: #6c757d;
  border: 1px solid #d0d0d0;
  border-radius: 4px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.edit-cancel-btn:hover {
  background: #f8f9fa;
  border-color: #6c757d;
  color: #495057;
}

/* ============================================
   PROFESSIONAL INPUTS
   ============================================ */

.input {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 2px solid #d0d0d0;
  border-radius: 4px;
  font-size: 0.9rem;
  outline: none;
  transition: all 0.2s ease;
  background: white;
  font-family: inherit;
}

.input:hover {
  border-color: #b0b0b0;
}

.input:focus {
  border-color: #0066CC;
  box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

.input:disabled {
  background: #f5f5f5;
  color: #999;
  cursor: not-allowed;
  border-color: #e0e0e0;
}

.input-sm {
  padding: 0.5rem 0.75rem;
  font-size: 0.85rem;
}

.input::placeholder {
  color: #999;
  font-style: italic;
}

.search-input {
  flex: 1;
  padding: 1rem 1.5rem;
  border: 2px solid #d0d0d0;
  border-radius: 4px;
  font-size: 0.95rem;
  outline: none;
  transition: all 0.2s ease;
  font-family: inherit;
}

.search-input:focus {
  border-color: #0066CC;
  box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

.file-input {
  width: 100%;
  padding: 0.75rem;
  border: 2px dashed #d0d0d0;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
  background: #fafafa;
}

.file-input:hover {
  border-color: #0066CC;
  background: white;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: #2c3e50;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

/* ============================================
   SEARCH
   ============================================ */

.search-box {
  display: flex;
  gap: 1rem;
  margin-bottom: 2rem;
}

.search-results {
  margin-top: 2rem;
}

.results-count {
  font-weight: 600;
  color: #0066CC;
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  font-size: 0.9rem;
}

.no-results {
  text-align: center;
  padding: 3rem;
  color: #7f8c8d;
  font-size: 1.1rem;
}

.no-results small {
  display: block;
  margin-top: 0.5rem;
  font-size: 0.9rem;
}

.result-card {
  background: #f8f9fa;
  padding: 1.5rem;
  border-radius: 6px;
  margin-bottom: 1rem;
  border: 1px solid #e0e0e0;
  transition: all 0.2s ease;
}

.result-card:hover {
  box-shadow: 0 4px 12px rgba(0, 102, 204, 0.15);
  border-color: #0066CC;
}

.result-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.result-source {
  font-weight: 600;
  color: #2c3e50;
}

.result-score {
  background: #0066CC;
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  font-size: 0.85rem;
  font-weight: 600;
}

.result-text {
  color: #555;
  line-height: 1.6;
  font-size: 0.95rem;
}

/* ============================================
   BADGES
   ============================================ */

.badge {
  display: inline-block;
  padding: 0.3rem 0.85rem;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.badge-success { 
  background: #d4edda; 
  color: #155724;
  border: 1px solid #c3e6cb;
}

.badge-warning { 
  background: #fff3cd; 
  color: #856404;
  border: 1px solid #ffeeba;
}

.badge-danger { 
  background: #f8d7da; 
  color: #721c24;
  border: 1px solid #f5c6cb;
}

.badge-info { 
  background: #cce5ff; 
  color: #004085;
  border: 1px solid #b8daff;
}

/* ============================================
   ACTIVITY CODE BADGE
   ============================================ */

.activity-code-badge {
  display: inline-block;
  background: linear-gradient(135deg, #0066CC 0%, #004999 100%);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  font-weight: 700;
  font-size: 0.9rem;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 6px rgba(0, 102, 204, 0.25);
  min-width: 80px;
  text-align: center;
  text-transform: uppercase;
}

.activity-description {
  font-weight: 600;
  color: #2c3e50;
  font-size: 1rem;
}

.activity-card {
  background: linear-gradient(to right, #f8f9fa, #ffffff);
  padding: 1.5rem;
  border-radius: 6px;
  margin-bottom: 1.25rem;
  border: 1px solid #e0e0e0;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.activity-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid #e0e0e0;
}

.activity-card p {
  margin: 0.5rem 0;
  font-size: 0.9rem;
  color: #495057;
}

.activity-card strong {
  color: #2c3e50;
  font-weight: 600;
}

/* ============================================
   ALERTS
   ============================================ */

.alert {
  padding: 1rem 1.5rem;
  border-radius: 6px;
  margin-bottom: 1.5rem;
  font-weight: 500;
  border: 1px solid transparent;
}

.alert-success {
  background: #d4edda;
  color: #155724;
  border-color: #c3e6cb;
}

.alert-error {
  background: #f8d7da;
  color: #721c24;
  border-color: #f5c6cb;
}

/* ============================================
   TABLES
   ============================================ */

table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

thead {
  background: linear-gradient(135deg, #0066CC 0%, #004999 100%);
  color: white;
}

th {
  padding: 1rem 1.25rem;
  text-align: left;
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

td {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid #e0e0e0;
  font-size: 0.9rem;
}

tbody tr:last-child td {
  border-bottom: none;
}

tbody tr:hover {
  background: #f8f9fa;
}

/* ============================================
   DATA TABLE SPECIFIC
   ============================================ */

.data-table {
  overflow-x: auto;
  border-radius: 6px;
}

.data-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.data-header h2 {
  margin: 0;
}

/* ============================================
   FILTERS
   ============================================ */

.filters {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.filters .input,
.filters select {
  flex: 1;
  min-width: 200px;
}

select.input {
  cursor: pointer;
  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='%23333' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 3rem;
}

/* ============================================
   MODAL
   ============================================ */

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: fadeIn 0.2s;
  backdrop-filter: blur(4px);
}

.modal-content {
  background: white;
  border-radius: 8px;
  max-width: 900px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.modal-large {
  max-width: 1100px;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 2rem;
  border-bottom: 2px solid #e0e0e0;
  background: linear-gradient(135deg, #0066CC 0%, #004999 100%);
  color: white;
  position: sticky;
  top: 0;
  z-index: 10;
}

.modal-header h2 {
  margin: 0;
  color: white;
  font-size: 1.3rem;
  font-weight: 700;
}

.modal-body {
  padding: 2rem;
}

.modal-content::-webkit-scrollbar {
  width: 8px;
}

.modal-content::-webkit-scrollbar-track {
  background: #f1f1f1;
}

.modal-content::-webkit-scrollbar-thumb {
  background: #0066CC;
  border-radius: 4px;
}

/* ============================================
   DETAIL SECTIONS (in modal)
   ============================================ */

.detail-section {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 2px solid #f0f0f0;
}

.detail-section:last-child {
  border-bottom: none;
  padding-bottom: 0;
  margin-bottom: 0;
}

.detail-section h3 {
  margin: 0 0 1rem 0;
  font-size: 1.1rem;
  color: #0066CC;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.25rem;
}

.detail-item {
  position: relative;
}

.detail-item label {
  display: block;
  font-weight: 600;
  color: #6c757d;
  font-size: 0.85rem;
  margin-bottom: 0.4rem;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.detail-item span {
  display: block;
  color: #2c3e50;
  font-size: 0.95rem;
  padding: 0.5rem 0;
}

/* Editable Fields */
.editable-field {
  position: relative;
  background: #f8f9fa;
  padding: 0.75rem;
  border-radius: 4px;
  border: 1px solid #e0e0e0;
  transition: all 0.2s ease;
}

.editable-field:hover {
  border-color: #0066CC;
  background: white;
}

.editable-field.is-null {
  background: #fff3cd;
  border-color: #ffc107;
}

.edit-input-group {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.edit-input {
  flex: 1;
  padding: 0.5rem;
  border: 2px solid #0066CC;
  border-radius: 4px;
  font-size: 0.9rem;
  outline: none;
  font-family: inherit;
}

/* ============================================
   FILE LIST
   ============================================ */

.file-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.file-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem;
  background: #f8f9fa;
  border-radius: 6px;
  border: 1px solid #e0e0e0;
  transition: all 0.2s ease;
}

.file-item:hover {
  box-shadow: 0 4px 12px rgba(0, 102, 204, 0.15);
  border-color: #0066CC;
}

.file-info {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex: 1;
}

.file-icon {
  font-size: 2rem;
}

.file-details {
  flex: 1;
}

.file-details strong {
  display: block;
  color: #2c3e50;
  font-size: 1rem;
  margin-bottom: 0.25rem;
}

.file-details small {
  color: #6c757d;
  font-size: 0.85rem;
}

.file-actions {
  display: flex;
  gap: 0.75rem;
}

.rename-input-group {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex: 1;
}

/* ============================================
   CAMERA/SCANNER
   ============================================ */

.camera-container {
  position: relative;
  margin: 2rem 0;
}

.camera-wrapper {
  position: relative;
  width: 100%;
  max-width: 800px;
  margin: 0 auto;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.camera-video {
  width: 100%;
  height: auto;
  display: block;
}

.a4-guide {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 70%;
  aspect-ratio: 210 / 297;
  border: 3px dashed #0066CC;
  border-radius: 4px;
  pointer-events: none;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.5);
}

.scan-line {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: #dc3545;
  animation: scanMove 3s ease-in-out infinite;
}

.scan-line.capturing {
  animation: scanCapture 0.8s ease-in-out;
}

@keyframes scanMove {
  0%, 100% { bottom: 0; }
  50% { bottom: calc(100% - 3px); }
}

@keyframes scanCapture {
  0% { background: #dc3545; }
  50% { background: #28a745; transform: scaleY(3); }
  100% { background: #dc3545; }
}

.camera-controls {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin: 1.5rem 0;
}

.scan-counter {
  text-align: center;
  font-weight: 600;
  color: #0066CC;
  margin-top: 1rem;
  font-size: 1.1rem;
}

.scanned-images {
  margin-top: 2rem;
}

.image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1.5rem;
  margin: 1.5rem 0;
}

.image-card {
  position: relative;
  border: 2px solid #e0e0e0;
  border-radius: 6px;
  padding: 0.75rem;
  background: white;
  transition: all 0.2s ease;
}

.image-card:hover {
  border-color: #0066CC;
  box-shadow: 0 4px 12px rgba(0, 102, 204, 0.15);
}

.scanned-image {
  width: 100%;
  height: auto;
  border-radius: 4px;
  margin-bottom: 0.75rem;
}

.page-number {
  display: block;
  text-align: center;
  font-weight: 600;
  color: #6c757d;
  font-size: 0.85rem;
  margin-top: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.scan-actions {
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 2px solid #e0e0e0;
}

.scan-start {
  text-align: center;
  padding: 3rem;
}

.scan-info {
  margin-top: 1rem;
  color: #6c757d;
  font-size: 0.95rem;
}

/* ============================================
   STATS CARDS
   ============================================ */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: white;
  padding: 1.5rem;
  border-radius: 6px;
  border: 1px solid #e0e0e0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  text-align: center;
  transition: all 0.2s ease;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 102, 204, 0.15);
  border-color: #0066CC;
}

.stat-card .stat-value {
  font-size: 2.5rem;
  font-weight: 700;
  color: #0066CC;
  line-height: 1;
}

.stat-card .stat-label {
  font-size: 0.9rem;
  color: #6c757d;
  margin-top: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}

/* ============================================
   AUDIT TABLE
   ============================================ */

.audit-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.audit-header h2 {
  margin: 0;
}

.audit-table {
  overflow-x: auto;
  border-radius: 6px;
  margin-top: 1.5rem;
}

/* ============================================
   UPLOAD SECTION
   ============================================ */

.upload-section {
  padding: 2rem 0;
}

.file-info {
  background: #f8f9fa;
  padding: 1.5rem;
  border-radius: 6px;
  border: 1px solid #e0e0e0;
  margin-top: 1rem;
}

.file-info p {
  margin-bottom: 1rem;
  color: #2c3e50;
}

/* ============================================
   EMPTY STATES
   ============================================ */

.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  color: #7f8c8d;
}

.empty-state p {
  font-size: 1.15rem;
  margin-bottom: 1.5rem;
  font-weight: 500;
}

.empty-state small {
  display: block;
  margin-top: 0.5rem;
  font-size: 0.95rem;
  color: #95a5a6;
}

.empty-state-sm {
  text-align: center;
  padding: 2rem;
  color: #95a5a6;
  font-style: italic;
}

/* ============================================
   NOTIFICATIONS
   ============================================ */

.notification {
  position: fixed;
  top: 20px;
  right: 20px;
  background: white;
  padding: 1rem 1.5rem;
  border-radius: 6px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  z-index: 10000;
  animation: slideIn 0.3s ease-out;
  min-width: 300px;
  border-left: 4px solid #0066CC;
}

.notification-success {
  border-left-color: #28a745;
}

.notification-error {
  border-left-color: #dc3545;
}

.notification-info {
  border-left-color: #0066CC;
}

@keyframes slideIn {
  from {
    transform: translateX(400px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* ============================================
   SCROLLBARS
   ============================================ */

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
  background: #0066CC;
  border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
  background: #004999;
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

@media (max-width: 768px) {
  .container {
    padding: 0 1rem;
  }
  
  .header-content {
    padding: 1rem 0;
  }
  
  .header-stats {
    display: none;
  }
  
  .logo h1 {
    font-size: 1.1rem;
  }
  
  .subtitle {
    font-size: 0.75rem;
  }
  
  .tabs {
    padding: 0.5rem 1rem;
    gap: 0.25rem;
  }
  
  .tab {
    padding: 0.6rem 1rem;
    font-size: 0.85rem;
  }
  
  .main-content {
    padding: 1rem;
  }
  
  .card {
    padding: 1.5rem;
  }
  
  .agent-container {
    height: calc(100vh - 220px);
  }
  
  .message-bubble {
    max-width: 85%;
  }
  
  .agent-input-container {
    flex-direction: column;
    gap: 0.75rem;
  }
  
  .agent-send-btn {
    width: 100%;
  }
  
  .agent-suggestions {
    flex-direction: column;
    align-items: stretch;
  }
  
  .suggestion-chip {
    width: 100%;
    text-align: center;
  }
  
  .detail-grid {
    grid-template-columns: 1fr;
  }
  
  .filters {
    flex-direction: column;
  }
  
  .filters .input {
    min-width: 100%;
  }
  
  .button-group {
    flex-direction: column;
  }
  
  .button-group .btn {
    width: 100%;
  }
  
  .file-item {
    flex-direction: column;
    gap: 1rem;
  }
  
  .file-actions {
    width: 100%;
    justify-content: stretch;
  }
  
  .file-actions .btn {
    flex: 1;
  }
  
  table {
    font-size: 0.85rem;
  }
  
  th, td {
    padding: 0.75rem;
  }
  
  .modal-content {
    width: 95%;
  }
  
  .modal-header {
    padding: 1rem 1.5rem;
  }
  
  .modal-header h2 {
    font-size: 1.1rem;
  }
  
  .modal-body {
    padding: 1.5rem;
  }
}

@media (max-width: 480px) {
  .logo-icon {
    width: 40px;
    height: 40px;
    font-size: 1rem;
  }
  
  .logo h1 {
    font-size: 1rem;
  }
  
  .tab {
    padding: 0.5rem 0.75rem;
    font-size: 0.8rem;
  }
  
  .card h2 {
    font-size: 1.2rem;
  }
  
  .btn {
    padding: 0.65rem 1.25rem;
    font-size: 0.85rem;
  }
  
  .image-grid {
    grid-template-columns: 1fr;
  }
}

/* ============================================
   PRINT STYLES
   ============================================ */

@media print {
  .header, .tabs, .btn, .agent-input-container, .agent-suggestions {
    display: none !important;
  }
  
  .main-content {
    padding: 0;
  }
  
  .card {
    box-shadow: none;
    border: 1px solid #000;
  }
  
  .modal-overlay {
    position: relative;
    background: transparent;
  }
  
  .modal-content {
    box-shadow: none;
    max-width: 100%;
  }
}

/* ============================================
   ACCESSIBILITY
   ============================================ */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

*:focus-visible {
  outline: 2px solid #0066CC;
  outline-offset: 2px;
}

.semantic-input {
  width: 450px;
  height: 44px;
  padding: 10px 14px;
  font-size: 16px;
  border-radius: 10px;
  border: 1px solid #d1d5db;
  outline: none;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}

.semantic-input:focus {
  border: 1px solid #0078ff;
  box-shadow: 0 0 0 2px rgba(0,120,255,0.2);
}


/* ============================================
   DARK MODE SUPPORT (Optional)
   ============================================ */

@media (prefers-color-scheme: dark) {
  /* Can add dark mode styles here if needed */
}