/* style.css */
:root {
  --primary-blue: #0d6efd;
  --primary-hover: #0b5ed7;
  --secondary-color: #6c757d;
  --bg-light: #f4f7fe;
  --card-bg: #ffffff;
  --text-main: #2b3674;
  --text-muted: #a3aed1;
  --border-light: #e9edf7;
  --sidebar-bg: #ffffff;
  --success: #05cd99;
  --warning: #ffce20;
  --danger: #ee5d50;
  --transition: all 0.3s ease;
  --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
  --border-radius-md: 14px;
  --border-radius-lg: 20px;
}
/* -------------------------------
   Mobile Responsive Fixes 
--------------------------------*/
html, body {
  overflow-x: hidden;
  width: 100%;
}

.main-wrapper, .content-area {
  min-width: 0; /* Prevents flexbox blowouts */
  overflow-x: hidden;
}
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Inter', sans-serif;
}

body {
  background-color: var(--bg-light);
  color: var(--text-main);
  -webkit-font-smoothing: antialiased;
}

a {
  text-decoration: none;
  color: var(--primary-blue);
  transition: var(--transition);
}

a:hover {
  color: var(--primary-hover);
}

/* -------------------------------
   Authentication Page 
--------------------------------*/
.auth-bg {
  background: linear-gradient(135deg, #f4f7fe 0%, #e0e9fa 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
}

.auth-wrapper {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}

.auth-card {
  background: var(--card-bg);
  padding: 40px;
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 420px;
}

.auth-header {
  text-align: center;
  margin-bottom: 30px;
}

.brand-logo {
  max-width: 150px;
  margin-bottom: 20px;
}

.auth-header h2 {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 8px;
}

.auth-header p {
  color: var(--text-muted);
  font-size: 14px;
}

.input-group {
  margin-bottom: 20px;
  text-align: left;
}

.input-group label {
  display: block;
  font-weight: 500;
  font-size: 14px;
  margin-bottom: 8px;
  color: var(--text-main);
}

.input-field {
  position: relative;
  display: flex;
  align-items: center;
}

.input-field i {
  position: absolute;
  left: 16px;
  color: var(--text-muted);
}

.input-field input {
  width: 100%;
  padding: 14px 14px 14px 45px;
  border: 1px solid var(--border-light);
  border-radius: var(--border-radius-md);
  font-size: 14px;
  color: var(--text-main);
  transition: var(--transition);
  background: #fbfdff;
}

.input-field input:focus {
  outline: none;
  border-color: var(--primary-blue);
  box-shadow: 0 0 0 4px rgba(13, 110, 253, 0.1);
  background: #ffffff;
}

.auth-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  font-size: 14px;
}

.checkbox-container {
  display: flex;
  align-items: center;
  cursor: pointer;
  color: var(--text-muted);
}

.checkbox-container input {
  margin-right: 8px;
  cursor: pointer;
  accent-color: var(--primary-blue);
  width: 16px;
  height: 16px;
}

.forgot-link {
  font-weight: 500;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  font-size: 14px;
  font-weight: 600;
  border-radius: var(--border-radius-md);
  border: none;
  cursor: pointer;
  transition: var(--transition);
}

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

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

.btn-block {
  width: 100%;
  padding: 14px;
  font-size: 15px;
}

/* -------------------------------
   Base App Layout (Sidebar & Header) 
--------------------------------*/
.app-container {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: 260px;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  position: fixed;
  height: 100vh;
  z-index: 100;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}

.sidebar-logo {
  padding: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid var(--border-light);
}

.sidebar-logo img {
  max-height: 35px;
}

.sidebar-menu {
  flex-grow: 1;
  padding: 20px 15px;
  overflow-y: auto;
}

.menu-title {
  font-size: 12px;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 12px;
  margin-top: 15px;
  padding-left: 10px;
  letter-spacing: 0.5px;
}

.menu-item {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  color: var(--secondary-color);
  border-radius: var(--border-radius-md);
  margin-bottom: 4px;
  font-weight: 500;
  font-size: 15px;
}

.menu-item i {
  margin-right: 14px;
  font-size: 18px;
  width: 20px;
  text-align: center;
}

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

.menu-item.active {
  background: var(--primary-blue);
  color: white;
  box-shadow: var(--shadow-sm);
}

.sidebar-footer {
  padding: 20px 15px;
  border-top: 1px solid var(--border-light);
}

/* Main Content Wrapper */
.main-wrapper {
  flex-grow: 1;
  margin-left: 260px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  transition: var(--transition);
}

/* Top Header */
.top-header {
  height: 80px;
  background: var(--bg-light); /* Blends with bg */
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 30px;
  position: sticky;
  top: 0;
  z-index: 90;
}

.header-left {
  display: flex;
  align-items: center;
}

.toggle-sidebar {
  background: none;
  border: none;
  font-size: 20px;
  color: var(--text-main);
  cursor: pointer;
  margin-right: 20px;
  display: none;
}

.page-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-main);
  margin: 0;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 24px;
  background: var(--card-bg);
  padding: 8px 16px;
  border-radius: 30px;
  box-shadow: var(--shadow-sm);
}

.header-icon {
  position: relative;
  font-size: 20px;
  color: var(--secondary-color);
  cursor: pointer;
  transition: var(--transition);
}

.header-icon:hover {
  color: var(--primary-blue);
}

.badge {
  position: absolute;
  top: -6px;
  right: -6px;
  background: var(--danger);
  color: white;
  border-radius: 50%;
  width: 18px;
  height: 18px;
  font-size: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  padding-left: 16px;

}

.avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
}

.user-info {
  text-align: left;
}

.user-info .user-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-main);
  display: block;
}

.user-info .user-role {
  font-size: 12px;
  color: var(--text-muted);
  display: block;
}

/* Content Area */
.content-area {
  padding: 0 30px 40px 30px;
  flex-grow: 1;
}

/* -------------------------------
   Responsive Breakpoints 
--------------------------------*/
@media (max-width: 991px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.show {
    transform: translateX(0);
  }
  .main-wrapper {
    margin-left: 0;
  }
  .toggle-sidebar {
    display: block;
  }
  .user-info {
    display: none;
  }
  .page-title {
    font-size: 20px;
  }
  .close-sidebar {
    display: block !important;
  }
  .sidebar-logo {
    justify-content: space-between !important;
  }
}
.close-sidebar {
  display: none;
  background: none;
  border: none;
  font-size: 20px;
  color: var(--text-main);
  cursor: pointer;
}
@media (max-width: 576px) {
  .content-area {
    padding: 0 15px 30px 15px;
  }
  .top-header {
    padding: 0 15px;
  }
  .header-right {
    gap: 12px;
    padding: 6px 12px;
  }
  .header-icon {
    font-size: 16px;
  }
  .avatar {
    width: 30px;
    height: 30px;
  }
  .badge {
    width: 14px;
    height: 14px;
    font-size: 8px;
    top: -4px;
    right: -4px;
  }
  .user-profile {
    padding-left: 10px;
  }
  .card {
    padding: 16px;
  }
  .table th, .table td {
    padding: 12px 10px;
    font-size: 13px;
  }
}

/* -------------------------------
   Dashboard Specific Styles
--------------------------------*/
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 24px;
  margin-top: 10px;
}

.stat-card {
  background: var(--card-bg);
  border-radius: var(--border-radius-lg);
  padding: 24px;
  display: flex;
  align-items: center;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.stat-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-md);
}

.stat-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  margin-right: 20px;
}

.bg-blue-light { background: rgba(13, 110, 253, 0.1); color: var(--primary-blue); }
.bg-success-light { background: rgba(5, 205, 153, 0.1); color: var(--success); }
.bg-warning-light { background: rgba(255, 206, 32, 0.1); color: var(--warning); }
.bg-danger-light { background: rgba(238, 93, 80, 0.1); color: var(--danger); }

.stat-details .stat-title {
  font-size: 14px;
  color: var(--text-muted);
  font-weight: 500;
  margin-bottom: 4px;
}

.stat-details .stat-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-main);
}

.dashboard-row {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
  margin-top: 24px;
}

.card {
  background: var(--card-bg);
  border-radius: var(--border-radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  max-width: 100%;
  overflow: hidden;
}

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

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

.btn-sm {
  padding: 8px 16px;
  font-size: 13px;
  border-radius: 20px;
}

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

.btn-outline:hover {
  background: var(--bg-light);
  border-color: var(--primary-blue);
  color: var(--primary-blue);
}

/* Tables */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch; /* For smooth scrolling on iOS */
  display: block; /* Forces block level scrolling */
}

.table {
  width: 100%;
  border-collapse: collapse;
}

.table th {
  text-align: left;
  padding: 12px 16px;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 13px;
  text-transform: uppercase;
  border-bottom: 1px solid var(--border-light);
  white-space: nowrap;
}

.table td {
  padding: 16px;
  vertical-align: middle;
  border-bottom: 1px solid var(--border-light);
  font-size: 14px;
  color: var(--text-main);
  white-space: nowrap;
}

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

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

.badge-status {
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  display: inline-block;
}

.status-active { background: rgba(13, 110, 253, 0.1); color: var(--primary-blue); }
.status-completed { background: rgba(5, 205, 153, 0.1); color: var(--success); }
.status-pending { background: rgba(255, 206, 32, 0.1); color: #b38f00; }

.timeline-list {
  list-style: none;
}

.timeline-item {
  position: relative;
  padding-left: 30px;
  margin-bottom: 20px;
}

.timeline-item:last-child {
  margin-bottom: 0;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 4px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--primary-blue);
  box-shadow: 0 0 0 4px rgba(13, 110, 253, 0.2);
}

.timeline-item.warning::before {
  background: var(--warning);
  box-shadow: 0 0 0 4px rgba(255, 206, 32, 0.2);
}

.timeline-item.success::before {
  background: var(--success);
  box-shadow: 0 0 0 4px rgba(5, 205, 153, 0.2);
}

.timeline-item::after {
  content: '';
  position: absolute;
  left: 5px;
  top: 20px;
  bottom: -20px;
  width: 2px;
  background: var(--border-light);
}

.timeline-item:last-child::after {
  display: none;
}

.timeline-content h4 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 4px;
}

.timeline-content p {
  font-size: 12px;
  color: var(--text-muted);
}

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

/* -------------------------------
   Modals and Page Layout Extras
--------------------------------*/
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  margin-top: 10px;
}

.page-header h2 {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-main);
}

.mt-4 { margin-top: 24px; }
.text-right { text-align: right !important; }

/* Action Buttons */
.action-btn {
  background: none;
  border: none;
  font-size: 16px;
  color: var(--text-muted);
  cursor: pointer;
  margin-right: 12px;
  transition: var(--transition);
}

.action-btn:hover { color: var(--primary-blue); }
.action-btn.delete:hover { color: var(--danger); }

/* Modal Elements */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
  backdrop-filter: blur(2px);
}

.modal-overlay.active {
  opacity: 1; visibility: visible;
}

.modal-content {
  background: var(--card-bg);
  width: 90%;
  max-width: 500px;
  border-radius: var(--border-radius-lg);
  padding: 30px;
  box-shadow: var(--shadow-lg);
  position: relative;
  transform: translateY(-20px);
  transition: var(--transition);
}

.modal-overlay.active .modal-content {
  transform: translateY(0);
}

.modal-close {
  position: absolute;
  top: 20px; right: 20px;
  background: none; border: none; font-size: 20px;
  color: var(--text-muted); cursor: pointer;
}

.modal-header {
  margin-bottom: 24px;
}

.modal-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-main);
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 30px;
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 8px;
}

.form-control {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border-light);
  border-radius: var(--border-radius-md);
  font-size: 14px;
  color: var(--text-main);
  background: #fbfdff;
  transition: var(--transition);
}

.form-control:focus {
  outline: none;
  border-color: var(--primary-blue);
  box-shadow: 0 0 0 4px rgba(13, 110, 253, 0.1);
  background: #ffffff;
}

textarea.form-control {
  resize: vertical;
  min-height: 100px;
}

/* -------------------------------
   Project Detail & Shipment Tracking
--------------------------------*/
.detail-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
}

@media (max-width: 991px) {
  .detail-grid {
    grid-template-columns: 1fr;
  }
}

.project-meta {
  display: flex;
  gap: 30px;
  flex-wrap: wrap;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--border-light);
}

.meta-item {
  display: flex;
  align-items: center;
  gap: 12px;
}

.meta-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--bg-light);
  color: var(--primary-blue);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

.meta-info p {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.meta-info h5 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-main);
}

/* File Attachments */
.file-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.file-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border: 1px solid var(--border-light);
  border-radius: var(--border-radius-md);
  transition: var(--transition);
}

.file-item:hover {
  background: var(--bg-light);
  border-color: var(--primary-blue);
}

.file-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.file-icon {
  font-size: 24px;
  color: var(--danger);
}

.file-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-main);
}

.file-size {
  font-size: 12px;
  color: var(--text-muted);
}

.file-actions button {
  background: none;
  border: none;
  color: var(--secondary-color);
  font-size: 16px;
  cursor: pointer;
  margin-left: 10px;
  transition: var(--transition);
}

.file-actions button:hover {
  color: var(--primary-blue);
}

/* Shipment-Style Tracking */
.tracking-container {
  padding: 10px 0;
}

.tracking-step {
  display: flex;
  margin-bottom: 30px;
  position: relative;
}

.tracking-step:last-child {
  margin-bottom: 0;
}

.tracking-step::after {
  content: '';
  position: absolute;
  left: 19px;
  top: 42px;
  bottom: -30px;
  width: 3px;
  background: var(--border-light);
}

.tracking-step:last-child::after {
  display: none;
}

.tracking-step.completed::after {
  background: var(--primary-blue);
}

.tracking-icon {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--bg-light);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  z-index: 2;
  position: relative;
  transition: var(--transition);
  border: 4px solid var(--card-bg);
  box-shadow: 0 0 0 1px var(--border-light);
}

.tracking-step.completed .tracking-icon {
  background: var(--primary-blue);
  color: white;
  box-shadow: 0 0 0 4px rgba(13, 110, 253, 0.2);
  border-color: var(--card-bg);
}

.tracking-step.current .tracking-icon {
  background: var(--warning);
  color: white;
  box-shadow: 0 0 0 4px rgba(255, 206, 32, 0.2);
  border-color: var(--card-bg);
}

.tracking-content {
  margin-left: 20px;
  padding-top: 5px;
}

.tracking-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 4px;
}

.tracking-desc {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.tracking-date {
  font-size: 11px;
  font-weight: 600;
  color: var(--secondary-color);
}

/* -------------------------------
   Responsive Grid Utilities
--------------------------------*/
.grid-1-1 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}
.grid-1-2 {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 24px;
}
.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
}

@media (max-width: 991px) {
  .grid-1-1, .grid-1-2 {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 576px) {
  .form-grid-2 {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  
}
/* -------------------------------
   Modal Mobile Responsive Fixes 
--------------------------------*/
.modal-overlay {
  padding: 15px; /* மொபைலில் ஓரத்தில் கொஞ்சம் இடைவெளிக்காக */
}

.modal-content {
  max-height: 90vh; /* Screen height-ஐ விட பெருசா போகாம தடுக்க */
  overflow-y: auto; /* Content அதிகமா இருந்தா scroll ஆக */
}

/* Scrollbar-ஐ மறைக்க (பார்க்க நீட்டாக இருக்க) */
.modal-content::-webkit-scrollbar {
  width: 5px;
}
.modal-content::-webkit-scrollbar-thumb {
  background: var(--border-light);
  border-radius: 10px;
}

@media (max-width: 576px) {
  .modal-content {
    width: 100%;
    padding: 24px 15px; 
    max-height: 95vh;
  }
  
  .modal-header {
    margin-bottom: 15px;
  }
  
  /* மொபைலில் பட்டன்களை முழு நீளத்திற்கு மாற்ற */
  .modal-footer {
    flex-direction: column;
    gap: 10px;
    margin-top: 20px;
  }
  
  .modal-footer .btn {
    width: 100%;
    margin: 0;
  }
}