/* Base Reset */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

html, body {
  height: 100%;
  background-color: #fff;
  display: flex;
  flex-direction: column;
}

/* Layout Wrapper */
.wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
}

header {
  height: 60px;
  width: 100%;
  background-color: #2c3e50;
  color: #fff;
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 20px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  z-index: 1000;
  flex-shrink: 0;
  margin-bottom: 0; /* Important: header ke neeche koi margin na ho */
}

header h1 {
  font-size: 22px;
  font-weight: 700;
  flex-grow: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin: 0; /* Heading ke around extra margin na ho */
}

.year-heading {
  text-align: center;
  font-weight: bold;
  font-size: 24px;
  margin: 0; /* Top aur bottom dono margin hata den */
  padding: 10px 0; /* Thoda vertical padding agar chahiye */
}

.year-heading h3 {
  margin: 0; /* h3 ke andar bhi margin hata den */
}

/* Hamburger Icon */
.hamburger {
  font-size: 28px;
  width: 44px;
  height: 44px;
  background-color: #34495e;
  color: #fff;
  border: none;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  transition: background-color 0.3s ease;
}

.hamburger:hover {
  background-color: #3d566e;
}

@media (min-width: 768px) {
  .hamburger {
    display: none;
  }
}


/* Hamburger Icon */
.hamburger {
  font-size: 26px;
  width: 40px;
  height: 40px;
  background-color: #34495e;
  color: #fff;
  border: none;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  transition: background-color 0.3s ease;
}

.hamburger:hover {
  background-color: #3d566e;
}


/* Main Content */
main {
  flex: 1;
  padding: 20px;
  padding-top: auto;
  max-width: 100%;
  overflow-x: auto;
  transition: margin-left 0.3s ease;
}

main h3:first-of-type {
  margin-top: 0;
}

/* Footer */
footer {
  background-color: #2c3e50;
  color: white;
  text-align: center;
  padding: 15px 20px;
  font-size: 14px;
  width: 100%;
  flex-shrink: 0;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 20px;
  table-layout: auto; /* Allow automatic width based on content */
  overflow-x: auto;
  /* Add this so table can expand naturally */
  min-width: max-content;
}

table th, table td {
  border: 1px solid #ccc;
  padding: 10px 15px;
  font-size: 16px;
  vertical-align: middle;
  white-space: normal; /* allow wrapping */
  overflow-wrap: break-word;
  text-overflow: clip;
  width: auto !important; /* Make sure no fixed width */
  max-width: none !important;
}

table th {
  background-color: #2c3e50;
  color: white;
  text-align: left;
  white-space: nowrap; /* no wrap on headers */
}

.date-cell {
  white-space: nowrap !important; /* prevent date break */
  text-align: center;
  font-weight: 600;
  color: #1c3d5a;
  width: auto !important;
  max-width: none !important;
}

/* Table container to allow horizontal scroll on overflow */
.table-container {
  overflow-x: auto;
  width: 100%;
  /* Prevent container from shrinking smaller than table */
  min-width: 0;
}

/* Limit column width for firm name or any long text column */
td.firm-name, th.firm-name {
  max-width: 220px;        /* apne hisaab se adjust karo */
  white-space: normal;     /* allow wrapping */
  overflow-wrap: break-word;
  word-wrap: break-word;
  display: -webkit-box;    /* For multiline truncation */
  -webkit-line-clamp: 2;   /* Limit to 2 lines */
  -webkit-box-orient: vertical;
  overflow: hidden;        /* hide overflow after 2 lines */
  text-overflow: ellipsis; /* show ... if overflow */
}

/* Agar aap header me bhi ye chahte ho */
th.firm-name {
  white-space: normal;
  max-width: 220px;
}

/* Floating Add Button */
.add-customer {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 1000;
}

.add-customer-btn {
  text-decoration: none;
  color: inherit;
  font-size: 16px;
}

.plus-icon {
  background-color: #4CAF50;
  color: white;
  border-radius: 50%;
  padding: 12px 16px;
  font-size: 24px;
  font-weight: bold;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.plus-icon:hover {
  background-color: #45a049;
}

/* Dashboard Cards */
.dashboard-grid {
  margin-top: 30px;
  padding: 10px;
  overflow-x: auto;
  white-space: nowrap;
}

.dashboard-card {
  display: inline-block;
  min-width: 200px;
  padding: 15px;
  margin-right: 15px;
  border-radius: 8px;
  text-align: center;
  font-size: 16px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  user-select: none;
}

.dashboard-card h2 {
  font-size: 18px;
  margin-bottom: 10px;
  font-weight: bold;
}

.dashboard-card p {
  font-size: 18px;
  margin: 0;
}

/* Card Colors */
.total-amount {
  background-color: #eaf7e4;
  color: #2d6a4f;
}

.receive-amount {
  background-color: #c1f0c1;
  color: #3b7a3b;
}

.due-amount {
  background-color: #ffebcc;
  color: #d9771b;
}

.cancelled-amount {
  background-color: #f7b0b0;
  color: #9d1b1b;
}

@media (max-width: 768px) {
  .dashboard-card {
    min-width: 160px;
  }
}
.weekly-report-btn-wrapper {
  display: flex !important;       /* force flex */
  justify-content: flex-start !important;  /* left align */
  align-items: center;
  width: 100%;
  padding: 1rem 0;
}

/* Button ko absolute se hata ke flex use karenge taaki left aligned ho aur responsive bhi rahe */
.weekly-report-btn-wrapper {
  display: flex;
  align-items: center;
  justify-content: flex-start; /* left align */
}

.view-report-icon-btn {
  background: linear-gradient(135deg, #0d6efd, #0a58ca);
  border: none;
  border-radius: 50%;
  width: 60px;
  height: 60px;
  color: white;
  font-size: 1.8rem;
  box-shadow: 0 4px 10px rgba(13, 110, 253, 0.4);
  cursor: pointer;
  transition: all 0.3s ease;
  /* absolute position hata diya */
  position: static; 
  margin-left: 0; /* left se start */
}

.view-report-icon-btn:hover,
.view-report-icon-btn:focus {
  background: linear-gradient(135deg, #0b5ed7, #084298);
  box-shadow: 0 8px 16px rgba(11, 94, 215, 0.6);
  transform: translateY(-2px);
  outline: none;
}

/* Responsive adjustment */
@media (max-width: 400px) {
  .view-report-icon-btn {
    width: 50px;
    height: 50px;
    font-size: 1.5rem;
  }
}
/* Paid + Delivery Yes: full green (paid) with blue border */
.paid-delivery-yes td {
    background-color: #d4edda; /* green */
    color: #155724;
}
.paid-delivery-yes td:first-child {
    border-left: 6px solid #007bff; /* blue */
}

/* Paid + Delivery No: half green + half orange gradient */
.paid-delivery-no td {
    background: linear-gradient(to right, #d4edda 50%, #fff3cd 50%);
    color: #155724;
}
.paid-delivery-no td:first-child {
    border-left: 6px solid #fd7e14; /* orange */
}

/* Cancel + Delivery Yes: full red (cancel) with blue border */
.cancel-delivery-yes td {
    background-color: #f8d7da; /* red */
    color: #721c24;
}
.cancel-delivery-yes td:first-child {
    border-left: 6px solid #007bff; /* blue */
}

/* Cancel + Delivery No: full red (cancel) with orange border */
.cancel-delivery-no td {
    background-color: #f8d7da; /* red */
    color: #721c24;
}
.cancel-delivery-no td:first-child {
    border-left: 6px solid #fd7e14; /* orange */
}

/* Unknown payment + Delivery Yes: light blue bg with default text */
.unknown-delivery-yes td {
    background-color: #cce5ff; /* light blue */
    color: #004085;
}
.unknown-delivery-yes td:first-child {
    border-left: 6px solid #007bff; /* blue */
}

/* Unknown payment + Delivery No: light orange bg with default text */
.unknown-delivery-no td {
    background-color: #fff3cd; /* light orange/yellow */
    color: #856404;
}
.unknown-delivery-no td:first-child {
    border-left: 6px solid #fd7e14; /* orange */
}

/* Fallback for unknown delivery */
.unknown-delivery-unknown td {
    background-color: #e2e3e5; /* gray */
    color: #383d41;
}
.unknown-delivery-unknown td:first-child {
    border-left: 6px solid #6c757d; /* gray border */
}

