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

:root {
  --primary-color: #0066cc;
  --primary-dark: #0052a3;
  --secondary-color: #ff6b35;
  --success-color: #22c55e;
  --warning-color: #f59e0b;
  --danger-color: #ef4444;
  --text-dark: #1f2937;
  --text-light: #6b7280;
  --border-color: #e5e7eb;
  --bg-light: #f9fafb;
  --bg-white: #ffffff;
  --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);
}

html, body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background-color: var(--bg-light);
  color: var(--text-dark);
  line-height: 1.6;
}

/* Loading Screen */
.loading-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  overflow: hidden;
}

.loading-boats-container {
  position: relative;
  width: 100%;
  height: 400px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.splash-logo {
  position: fixed;
  top: 20px;
  left: 0;
  right: 0;
  text-align: center;
  z-index: 10001;
}

.splash-logo .logo-image {
  max-width: 200px;
  height: auto;
  display: block;
}

.loading-spinner {
  text-align: center;
  color: var(--primary-color);
  position: relative;
  z-index: 10;
}

.spinner {
  width: 50px;
  height: 50px;
  border: 4px solid rgba(0, 102, 204, 0.2);
  border-top: 4px solid var(--primary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 20px;
}

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

.loading-spinner p {
  font-size: 16px;
  margin: 0;
  font-weight: 500;
}

/* Animated Boats */
.boat {
  position: absolute;
  width: 80px;
  height: 60px;
  left: -100px;
  visibility: hidden;
  overflow: hidden;
}

.boat img {
  height: 60px;
  width: auto;
  display: block;
}

.boat-top {
  top: 90px;
  animation: slideAcross 12.5s linear infinite both;
}

.boat-bottom {
  bottom: 180px;
  animation: slideAcross 5s linear infinite 1s both;
}

@keyframes slideAcross {
  0% {
    left: -100px;
    visibility: hidden;
  }
  1% {
    visibility: visible;
  }
  99% {
    visibility: visible;
  }
  100% {
    left: 100vw;
    visibility: hidden;
  }
}

.loading-screen.hidden {
  display: none;
}

/* Login Styles */
.login-container {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  min-height: 100vh;
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
  padding: 40px 20px 20px 20px;
}

.login-card {
  background: var(--bg-white);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 400px;
  padding: 28px 40px;
}

.login-logo {
  text-align: center;
  margin-bottom: 20px;
}

.logo-image {
  max-width: 200px;
  height: auto;
  display: block;
  margin: 0 auto;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

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

.form-group label {
  font-weight: 600;
  font-size: 14px;
  color: var(--text-dark);
}

.form-group input,
.form-group select {
  padding: 12px 14px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 16px;
  transition: all 0.3s ease;
  font-family: inherit;
}

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

/* Buttons */
.btn {
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

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

.btn-primary:hover {
  background-color: var(--primary-dark);
  box-shadow: var(--shadow-md);
}

.btn-primary:active {
  transform: scale(0.98);
}

.btn-secondary {
  background-color: var(--bg-light);
  color: var(--primary-color);
  border: 1px solid var(--border-color);
}

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

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

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

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

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

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

.btn-block {
  width: 100%;
}

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

.btn-icon {
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 50%;
  font-size: 18px;
}

.divider {
  text-align: center;
  color: var(--text-light);
  font-size: 14px;
  margin: 10px 0;
}

/* Dashboard Layout */
.dashboard {
  display: flex;
  height: 100vh;
  background: var(--bg-light);
  width: 100%;
}

.sidebar {
  width: 280px;
  background: var(--bg-white);
  border-right: 1px solid var(--border-color);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.sidebar-header {
  padding: 0 12px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-light);
  height: 60px;
}

.sidebar-logo {
  max-width: 180px;
  height: auto;
  display: block;
  object-fit: contain;
}

.sidebar-menu {
  flex: 1;
  padding: 20px 0;
  list-style: none;
}

.sidebar-menu li {
  margin: 0;
}

.sidebar-menu a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  color: var(--text-dark);
  text-decoration: none;
  font-weight: 500;
  transition: all 0.3s ease;
  cursor: pointer;
}

.sidebar-menu a:hover {
  background: var(--bg-light);
  color: var(--primary-color);
}

.sidebar-menu a.active {
  background: rgba(0, 102, 204, 0.1);
  color: var(--primary-color);
  border-left: 3px solid var(--primary-color);
  padding-left: 17px;
}

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: var(--bg-light);
  border-radius: 8px;
  cursor: pointer;
}

.user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--primary-color);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 16px;
}

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

.user-name {
  font-weight: 600;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-role {
  font-size: 12px;
  color: var(--text-light);
}

.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  width: 100%;
  max-width: none;
}

.top-bar {
  background: var(--bg-white);
  border-bottom: 1px solid var(--border-color);
  padding: 0 30px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 60px;
}

.menu-toggle {
  display: none;
}

.top-bar-title {
  display: flex;
  align-items: center;
}

.top-bar-title h1 {
  font-size: 24px;
  font-weight: 700;
  margin: 0;
}

.content-area {
  flex: 1;
  overflow-y: auto;
  padding: 30px;
  width: 100%;
}

/* Cards */
.card {
  background: var(--bg-white);
  border-radius: 12px;
  padding: 20px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 20px;
  border: 1px solid var(--border-color);
  transition: all 0.3s ease;
}

.card:hover {
  box-shadow: var(--shadow-md);
  cursor: pointer;
}

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

.card-title {
  font-size: 16px;
  font-weight: 700;
}

.card-meta {
  font-size: 13px;
  color: var(--text-light);
  margin-top: 4px;
}

.card-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.card-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.card-label {
  font-weight: 600;
  font-size: 13px;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.card-value {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-dark);
}

/* Status Badge */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  text-transform: capitalize;
}

.badge-success {
  background: rgba(34, 197, 94, 0.2);
  color: #166534;
}

.badge-warning {
  background: rgba(245, 158, 11, 0.2);
  color: #92400e;
}

.badge-info {
  background: rgba(59, 130, 246, 0.2);
  color: #1e40af;
}

.badge-danger {
  background: rgba(239, 68, 68, 0.2);
  color: #7f1d1d;
}

/* Job List */
.jobs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.job-card {
  background: var(--bg-white);
  border-radius: 12px;
  border: 1px solid var(--border-color);
  overflow: hidden;
  transition: all 0.3s ease;
  cursor: pointer;
}

.job-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-4px);
}

.job-card-header {
  padding: 16px;
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
  color: white;
}

.job-card-boat {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 4px;
}

.job-card-date {
  font-size: 13px;
  opacity: 0.9;
}

.job-card-body {
  padding: 16px;
}

.job-card-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  font-size: 14px;
}

.job-card-label {
  font-weight: 600;
  color: var(--text-light);
}

.job-card-value {
  color: var(--text-dark);
  font-weight: 500;
}

.job-card-status {
  text-align: right;
}

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

.modal.active {
  display: flex;
}

.modal-content {
  background: var(--bg-white);
  border-radius: 12px;
  padding: 30px;
  max-width: 600px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
}

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

.modal-title {
  font-size: 20px;
  font-weight: 700;
}

.modal-close {
  background: none;
  border: none;
  font-size: 24px;
  color: var(--text-light);
  cursor: pointer;
  padding: 0;
}

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

/* Forms */
.form-section {
  margin-bottom: 24px;
}

.form-section-title {
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-light);
  margin-bottom: 12px;
  letter-spacing: 0.5px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.form-grid.full {
  grid-template-columns: 1fr;
}

textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-family: inherit;
  font-size: 14px;
  resize: vertical;
  min-height: 120px;
}

textarea:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

/* Responsive */
@media (max-width: 1024px) {
  .sidebar {
    width: 220px;
  }

  .content-area {
    padding: 20px;
  }

  .jobs-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .dashboard {
    flex-direction: column;
    position: relative;
  }

  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: 280px;
    height: 100vh;
    flex-direction: column;
    border-right: 1px solid var(--border-color);
    background: var(--bg-white);
    z-index: 100;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    overflow-y: auto;
  }

  .sidebar.active {
    transform: translateX(0);
  }

  .sidebar-header {
    padding: 12px;
  }

  .sidebar-logo {
    max-width: 140px;
  }

  .sidebar-menu {
    padding: 16px 0;
    flex-direction: column;
    display: flex;
  }

  .sidebar-menu a {
    padding: 12px 20px;
  }

  .sidebar-footer {
    display: flex;
    flex-direction: column;
    padding: 16px;
    border-top: 1px solid var(--border-color);
    margin-top: auto;
  }

  .main-content {
    width: 100%;
    flex: 1;
    display: flex;
    flex-direction: column;
  }

  .dashboard {
    width: 100%;
    padding: 0;
  }

  .top-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
  }

  .menu-toggle {
    display: block;
    background: none;
    border: none;
    font-size: 20px;
    color: var(--text-dark);
    cursor: pointer;
    padding: 6px 12px;
    flex-shrink: 0;
  }

  .top-bar-title {
    flex: 1;
    text-align: center;
  }

  .top-bar-title h1 {
    font-size: 24px;
    margin: 0;
  }

  .sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 50;
  }

  .sidebar-overlay.active {
    display: block;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .jobs-grid {
    grid-template-columns: 1fr;
  }

  .content-area {
    padding: 20px 16px;
  }

  .empty-state {
    padding: 40px 20px;
  }

  .empty-state i {
    font-size: 48px;
  }

  .empty-state h3 {
    font-size: 20px;
  }

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

/* Loading States */
.loading {
  display: inline-flex;
  gap: 6px;
}

.loading i {
  animation: spin 1s linear infinite;
}

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

/* Empty State */
.empty-state {
  text-align: center;
  padding: 60px 20px;
}

.empty-state i {
  font-size: 64px;
  color: var(--border-color);
  margin-bottom: 20px;
}

.empty-state h3 {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 8px;
}

.empty-state p {
  color: var(--text-light);
  margin-bottom: 20px;
}

/* Utility Classes */
.mt-3 {
  margin-top: 16px;
}

.mb-3 {
  margin-bottom: 16px;
}

.flex {
  display: flex;
}

.flex-between {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.gap-2 {
  gap: 12px;
}

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

.text-sm {
  font-size: 13px;
}

.text-muted {
  color: var(--text-light);
}

.bg-warning-light {
  background: rgba(245, 158, 11, 0.1);
}

.alert {
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 20px;
  display: flex;
  gap: 12px;
  align-items: start;
}

.alert-success {
  background: rgba(34, 197, 94, 0.1);
  color: #166534;
  border-left: 4px solid var(--success-color);
}

.alert-danger {
  background: rgba(239, 68, 68, 0.1);
  color: #7f1d1d;
  border-left: 4px solid var(--danger-color);
}

.alert-info {
  background: rgba(59, 130, 246, 0.1);
  color: #1e40af;
  border-left: 4px solid #3b82f6;
}
