/* styles.css - Time Entry Tool Styles */

:root {
  /* Color Palette */
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-light: #dbeafe;
  --secondary: #64748b;
  --secondary-hover: #475569;
  --danger: #dc2626;
  --danger-hover: #b91c1c;
  --success: #16a34a;
  --success-hover: #15803d;
  
  /* Neutrals */
  --gray-50: #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-300: #cbd5e1;
  --gray-600: #475569;
  --gray-700: #334155;
  --gray-900: #0f172a;
  
  /* Layout */
  --sidebar-width: 240px;
  --header-height: 64px;
  
  /* Typography */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Courier New', monospace;
  
  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  
  /* Border Radius */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
}

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

body {
  font-family: var(--font-sans);
  background: var(--gray-50);
  color: var(--gray-900);
  line-height: 1.6;
  overflow-x: hidden;
}

/* Layout Structure */
.app-container {
  display: flex;
  height: 100vh;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-width);
  background: white;
  border-right: 1px solid var(--gray-200);
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
}

.sidebar-header {
  padding: 20px;
  border-bottom: 1px solid var(--gray-200);
}

.sidebar-header h1 {
  font-size: 18px;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 4px;
}

.sidebar-header .user-email {
  font-size: 12px;
  color: var(--gray-600);
  word-break: break-word;
}

.sidebar-nav {
  flex: 1;
  padding: 16px 0;
}

.nav-item {
  display: flex;
  align-items: center;
  padding: 12px 20px;
  color: var(--gray-700);
  cursor: pointer;
  transition: all 0.2s;
  border-left: 3px solid transparent;
  font-weight: 500;
  font-size: 14px;
}

.nav-item:hover {
  background: var(--gray-100);
  color: var(--primary);
}

.nav-item.active {
  background: var(--primary-light);
  color: var(--primary);
  border-left-color: var(--primary);
}

.nav-icon {
  margin-right: 12px;
  font-size: 18px;
}

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--gray-200);
}

/* Main Content */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.content-header {
  height: var(--header-height);
  background: white;
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  box-shadow: var(--shadow-sm);
}

.content-header h2 {
  font-size: 24px;
  font-weight: 700;
  color: var(--gray-900);
}

.content-body {
  flex: 1;
  overflow-y: auto;
  padding: 32px;
  min-height: 0;
}

#timeEntryView,
#adminView {
  display: flex;
  flex-direction: column;
  height: 100%;
}
/* Cards & Sections */
.card {
  background: white;
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--gray-200);
}

.card-header {
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 2px solid var(--gray-100);
}

.card-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--gray-900);
}

.card-subtitle {
  font-size: 14px;
  color: var(--gray-600);
  margin-top: 4px;
}

/* Forms */
.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.form-group {
  display: flex;
  flex-direction: column;
}

.form-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 6px;
}

.form-label.required::after {
  content: ' *';
  color: var(--danger);
}

.form-input,
.form-select {
  padding: 10px 12px;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-md);
  font-size: 14px;
  font-family: var(--font-sans);
  transition: all 0.2s;
  background: white;
}

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

.form-input:disabled,
.form-select:disabled {
  background: var(--gray-100);
  cursor: not-allowed;
}

.form-input.error {
  border-color: var(--danger);
}

.form-error {
  font-size: 12px;
  color: var(--danger);
  margin-top: 4px;
}

/* Buttons */
.btn {
  padding: 10px 20px;
  border: none;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-sans);
}

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

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

.btn-primary:hover:not(:disabled) {
  background: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

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

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

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

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

.btn-outline {
  background: white;
  color: var(--primary);
  border: 1px solid var(--primary);
}

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

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
}

.btn-group {
  display: flex;
  gap: 12px;
  margin-top: 20px;
}

/* Tables */
.table-container {
  overflow-x: auto;
  margin-top: 16px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

thead {
  background: var(--gray-100);
}

th {
  text-align: left;
  padding: 12px;
  font-weight: 600;
  color: var(--gray-700);
  border-bottom: 2px solid var(--gray-300);
}

td {
  padding: 12px;
  border-bottom: 1px solid var(--gray-200);
}

tbody tr:hover {
  background: var(--gray-50);
}

.table-actions {
  display: flex;
  gap: 8px;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--gray-600);
}

.empty-state-icon {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.5;
}

.empty-state-title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--gray-700);
}

.empty-state-text {
  font-size: 14px;
}

/* Loading State */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px;
}

.spinner {
  border: 3px solid var(--gray-200);
  border-top-color: var(--primary);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 0.8s linear infinite;
}

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

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

.badge-success {
  background: #dcfce7;
  color: var(--success);
}

.badge-warning {
  background: #fef3c7;
  color: #d97706;
}

.badge-info {
  background: var(--primary-light);
  color: var(--primary);
}

/* Utility Classes */
.hidden {
  display: none !important;
}

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

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

.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }

/* Sign In Page */
.signin-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
}

.signin-card {
  background: white;
  padding: 48px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  text-align: center;
  max-width: 400px;
  width: 90%;
}

.signin-card h1 {
  font-size: 28px;
  margin-bottom: 12px;
  color: var(--gray-900);
}

.signin-card p {
  color: var(--gray-600);
  margin-bottom: 32px;
  font-size: 14px;
}

/* Responsive */
@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    left: -100%;
    transition: left 0.3s;
    z-index: 100;
  }
  
  .sidebar.open {
    left: 0;
  }
  
  .form-row {
    grid-template-columns: 1fr;
  }
}

/* Week Summary */
.week-summary {
  display: flex;
  justify-content: space-between;
  padding: 16px;
  background: var(--gray-50);
  border-radius: var(--radius-md);
  margin-bottom: 16px;
}

.week-summary-item {
  text-align: center;
}

.week-summary-label {
  font-size: 12px;
  color: var(--gray-600);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.week-summary-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--gray-900);
  margin-top: 4px;
}

/* Admin Panel Specific */
.admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
}

.stat-card {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
  color: white;
  padding: 24px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}

.stat-card h3 {
  font-size: 14px;
  font-weight: 600;
  opacity: 0.9;
  margin-bottom: 8px;
}

.stat-card .stat-value {
  font-size: 36px;
  font-weight: 700;
}

/* User Search Dropdown */
.user-search-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border: 1px solid var(--gray-300);
  border-radius: 4px;
  max-height: 200px;
  overflow-y: auto;
  box-shadow: var(--shadow-md);
  z-index: 1001;
  display: none;
  margin-top: 4px;
}

.user-search-item {
  padding: 10px 12px;
  cursor: pointer;
  border-bottom: 1px solid var(--gray-200);
}

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

.user-search-item:hover {
  background: var(--gray-100);
}

.user-search-name {
  font-weight: 500;
  color: var(--gray-900);
  font-size: 14px;
}

.user-search-email {
  font-size: 12px;
  color: var(--gray-600);
  margin-top: 2px;
}
