@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

:root {
  --primary: #1665ff;
  --primary-dark: #0f4fc9;
  --primary-light: #4c92ff;
  --primary-gradient: linear-gradient(135deg, #1665ff, #4c92ff);
  --bg-main: #eef4ff;
  --bg-white: #ffffff;
  --bg-light: #f7f9ff;
  --bg-hover: #edf4ff;
  --text-primary: #1a1a2e;
  --text-secondary: #444444;
  --text-muted: #888888;
  --text-light: #999999;
  --success: #22c55e;
  --success-bg: #ddf8e7;
  --warning: #f59e0b;
  --warning-bg: #fff4d8;
  --danger: #d62828;
  --danger-bg: #ffe3e3;
  --info: #1665ff;
  --info-bg: #edf4ff;
  --shadow-sm: 0 8px 18px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 15px 30px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 20px 45px rgba(22, 101, 255, 0.15);
  --shadow-xl: 0 25px 60px rgba(0, 0, 0, 0.18);
  --radius-sm: 12px;
  --radius-md: 16px;
  --radius-lg: 20px;
  --radius-xl: 24px;
  --sidebar-width: 270px;
  --sidebar-collapsed: 90px;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Poppins', sans-serif;
}

body{
    background:var(--bg-main);
    color:var(--text-secondary);
    overflow-x:hidden;
    width:100%;
}

/* Only enforce a desktop-style minimum width on screens that actually have
   room for it — never on tablets/phones, where it was forcing the whole
   page (sidebar, main, modals) to lay out at 1200px and then get visually
   squeezed/scaled by the mobile browser. */
@media (min-width: 1201px) {
  body {
    min-width: 1200px;
  }
}

a {
  text-decoration: none;
  color: inherit;
}

button {
  border: none;
  cursor: pointer;
  font-family: inherit;
}

img {
  max-width: 100%;
  display: block;
}
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-main);
}
::-webkit-scrollbar-thumb {
  background: var(--primary);
  border-radius: 20px;
}
.container {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  left: 0;
  top: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--bg-white);
  padding: 25px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--shadow-md);
  z-index: 100;
  transition: width var(--transition);
  overflow: hidden;
}

.sidebar .logo{
    display:flex;
    justify-content:center;
    align-items:center;
    margin-bottom:15px;
}

.sidebar .logo img{
    width:120px;
    height:120px;
    object-fit:contain;
}

.sidebar ul {
  list-style: none;
  flex: 1;
}

.sidebar ul li {
  list-style: none;
  margin-bottom: 12px;
}

.sidebar ul li a{
  display:flex;
  align-items:center;
  gap:18px;
  width:100%;
  padding:15px 18px;
  border-radius:12px;
  color:var(--text-secondary);
  font-weight:500;
  transition:.3s;
}

.sidebar ul li i{
    width:26px;
    min-width:26px;
    text-align:center;
    font-size:19px;
}

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

.sidebar ul li.active a{
  background:var(--primary-gradient);
  color:#fff;
  box-shadow:0 15px 28px rgba(22,101,255,.28);
}

.sidebar-profile {
  display: flex;
  align-items: center;
  gap: 15px;
  background: var(--bg-light);
  padding: 15px;
  border-radius: var(--radius-md);
  margin-top: auto;
}

.sidebar-profile img {
  width: 55px;
  height: 55px;
  border-radius: 50%;
  object-fit: cover;
}

.sidebar-profile h4 {
  font-size: 15px;
  color: var(--text-primary);
}

.sidebar-profile p {
  color: var(--text-muted);
  font-size: 13px;
}

.sidebar-profile .online {
  width: 10px;
  height: 10px;
  background: var(--success);
  border-radius: 50%;
  display: inline-block;
}

main{
    margin-left:var(--sidebar-width);
    width:calc(100% - var(--sidebar-width));
    padding:2vw;
}

header,
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 35px;
}

header h1,
.topbar h1 {
  font-size: 34px;
  color: var(--text-primary);
}

header p,
.topbar p {
  color: var(--text-muted);
  margin-top: 5px;
}

.right-header,
.right {
  display: flex;
  align-items: center;
  gap: 18px;
}

.search {
  width: 360px;
  height: 52px;
  background: var(--bg-white);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 18px;
  box-shadow: var(--shadow-sm);
}

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

.search input {
  width: 100%;
  border: none;
  outline: none;
  background: none;
  font-size: 15px;
  color: var(--text-secondary);
}

.search input::placeholder {
  color: var(--text-light);
}

.right-header button,
.topbar button {
  width: 48px;
  height: 48px;
  border: none;
  border-radius: 50%;
  background: var(--bg-white);
  cursor: pointer;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: var(--text-secondary);
}

.right-header button:hover,
.topbar button:hover {
  background: var(--primary);
  color: #fff;
}

.profile {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}

.profile img {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
}

.profile h4 {
  font-size: 15px;
  color: var(--text-primary);
}

.profile p {
  color: var(--text-muted);
  font-size: 13px;
}

.cards {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 22px;
  margin-bottom: 35px;
}

.card {
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  padding: 22px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  cursor: pointer;
}

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

.card span {
  color: var(--text-muted);
  font-size: 14px;
}

.card h2 {
  margin: 8px 0;
  font-size: 30px;
  color: var(--text-primary);
}

.card p {
  font-size: 13px;
  color: var(--text-muted);
}

.card i {
  width: 65px;
  height: 65px;
  border-radius: 18px;
  background: var(--bg-hover);
  color: var(--primary);
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 26px;
  flex-shrink: 0;
}

.top-actions {
  display: flex;
  justify-content: flex-end;
  gap: 16px;
  margin-bottom: 25px;
}

.export,
.add-product,
.add-user,
.add-service,
.generate {
  border: none;
  padding: 14px 28px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 15px;
  font-weight: 600;
  transition: var(--transition);
}

.export {
  background: var(--bg-white);
  color: #555;
  box-shadow: var(--shadow-sm);
}

.export:hover {
  background: var(--bg-hover);
}

.add-product,
.add-user,
.add-service,
.generate {
  background: var(--primary-gradient);
  color: #fff;
  box-shadow: 0 15px 28px rgba(22, 101, 255, 0.25);
}

.add-product:hover,
.add-user:hover,
.add-service:hover,
.generate:hover {
  transform: translateY(-3px);
}

.filter-section {
  background: var(--bg-white);
  padding: 22px;
  border-radius: 18px;
  display: flex;
  gap: 18px;
  align-items: center;
  margin-bottom: 30px;
  box-shadow: var(--shadow-sm);
  flex-wrap: wrap;
}

.filter-box {
  flex: 1;
  min-width: 150px;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid #e8e8e8;
  border-radius: var(--radius-sm);
  padding: 14px 18px;
}

.filter-box i {
  color: var(--primary);
}

.filter-box input,
.filter-box select {
  width: 100%;
  border: none;
  outline: none;
  background: none;
  font-size: 15px;
  color: var(--text-secondary);
}

.filter-box select {
  cursor: pointer;
  appearance: none;
}

.filter-btn {
  border: none;
  background: var(--primary);
  color: #fff;
  padding: 14px 28px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-weight: 600;
  transition: var(--transition);
  white-space: nowrap;
}

.filter-btn:hover {
  background: var(--primary-dark);
}

.table-container {
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

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

thead {
  background: var(--primary);
  color: #fff;
}

thead th {
  padding: 18px;
  text-align: left;
  font-size: 14px;
  font-weight: 600;
}

tbody td {
  padding: 16px 18px;
  border-bottom: 1px solid #f0f0f0;
  color: var(--text-secondary);
  font-size: 14px;
}

tbody tr {
  transition: var(--transition);
}

tbody tr:hover {
  background: #f8fbff;
}

tbody input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.stock,
.status,
.role-badge {
  padding: 8px 14px;
  border-radius: 30px;
  font-size: 13px;
  font-weight: 600;
  display: inline-block;
}

.stock.high,
.status.delivered,
.status.completed {
  background: var(--success-bg);
  color: #15924d;
}

.stock.medium,
.status.processing,
.status.in-progress {
  background: var(--warning-bg);
  color: #d18c00;
}

.stock.low,
.status.pending,
.status.cancelled {
  background: var(--danger-bg);
  color: var(--danger);
}

.status.pending {
  background: #fff2df;
  color: #d97706;
}

.status.processing {
  background: var(--info-bg);
  color: var(--primary);
}

.status.delivered {
  background: var(--success-bg);
  color: #15924d;
}

.status.cancelled {
  background: #f3f4f6;
  color: #555;
}

.role-badge.admin {
  background: #ffe6e6;
  color: #d91e18;
}

.role-badge.employee {
  background: var(--info-bg);
  color: var(--primary);
}

.role-badge.technician {
  background: #fff5db;
  color: #d89b00;
}

.role-badge.distributor {
  background: var(--success-bg);
  color: #149c50;
}

.payment.upi {
  background: var(--success-bg);
  color: #15924d;
}

.payment.card {
  background: var(--info-bg);
  color: var(--primary);
}

.payment.cod {
  background: #fff2df;
  color: #d97706;
}

.payment.netbanking {
  background: #f3ecff;
  color: #7c3aed;
}

.icon-btn {
  width: 38px;
  height: 38px;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--bg-hover);
  color: var(--primary);
  cursor: pointer;
  margin-right: 6px;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.icon-btn:hover {
  background: var(--primary);
  color: #fff;
}

.icon-btn.delete {
  background: var(--danger-bg);
  color: var(--danger);
}

.icon-btn.delete:hover {
  background: var(--danger);
  color: #fff;
}

.pagination {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
  margin-top: 30px;
}

.page,
.page-btn {
  width: 45px;
  height: 45px;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--bg-white);
  cursor: pointer;
  font-weight: 600;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}

.page:hover,
.page-btn:hover {
  background: var(--primary);
  color: #fff;
}

.page.active-page {
  background: var(--primary);
  color: #fff;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  padding: 20px;
}

.modal-content {
  width: 720px;
  max-width: 100%;
  background: var(--bg-white);
  border-radius: var(--radius-xl);
  padding: 30px;
  animation: popup 0.35s ease;
  box-shadow: var(--shadow-xl);
  max-height: 90vh;
  overflow-y: auto;
}

.modal-content.small {
  width: 460px;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 25px;
}

.modal-header h2,
.modal-header h3 {
  font-size: 24px;
  color: var(--text-primary);
}

.close {
  width: 45px;
  height: 45px;
  border: none;
  border-radius: 50%;
  background: var(--bg-hover);
  color: var(--primary);
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.close:hover {
  background: var(--primary);
  color: #fff;
}

.details-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.detail {
  display: flex;
  flex-direction: column;
}

.detail label {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.detail p {
  font-size: 15px;
  color: var(--text-primary);
  font-weight: 500;
}

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

form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

form input,
form select,
form textarea {
  width: 100%;
  border: 1px solid #e3e3e3;
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  outline: none;
  font-size: 15px;
  color: var(--text-secondary);
  transition: var(--transition);
  font-family: inherit;
}

form input:focus,
form select:focus,
form textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(22, 101, 255, 0.08);
}

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

form label {
  font-size: 14px;
  color: #555;
  font-weight: 600;
  grid-column: 1 / -1;
}

form .save-btn {
  grid-column: 1 / -1;
}

.save-btn {
  border: none;
  background: var(--primary-gradient);
  color: #fff;
  padding: 15px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 15px;
  font-weight: 600;
  transition: var(--transition);
}

.save-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 15px 30px rgba(22, 101, 255, 0.28);
}

.cancel-btn {
  border: none;
  background: var(--bg-hover);
  color: var(--primary);
  padding: 13px 24px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-weight: 600;
  transition: var(--transition);
}

.cancel-btn:hover {
  background: #dfe9ff;
}

.delete-btn {
  border: none;
  background: var(--danger);
  color: #fff;
  padding: 13px 24px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-weight: 600;
  transition: var(--transition);
}

.delete-btn:hover {
  background: #b91c1c;
}

.login-body {
  background: url('../images/login_pagee_bckground_option_2.jpeg');
  background-size: cover;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: 20px;
}

.login-container {
  display: flex;
  width: 900px;
  max-width: 90%;
  height: 85vh;
  max-height: 680px;
  border-radius: 24px;
  overflow: hidden;
  background: var(--bg-white);
  box-shadow: var(--shadow-xl);
}

.login-left {
  flex: .6;
  background: url('../images/left_background.jpg');
  background-size: cover;
  background-position: center;
  padding: 45px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
}

.login-left::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.85), rgba(255,255,255,0.4));
}

.login-left > * {
  position: relative;
  z-index: 2;
}

.login-left .logo img {
  width: 200px;
  margin-left: -10px;
}

.login-left h1 {
  font-size: 32px;
  color: #005ca9;
  margin-top: 10px;
  line-height: 1.2;
}

.login-left p {
  color: var(--text-secondary);
  font-size: 16px;
}

.login-features {
  display: flex;
  flex-direction: column;
  gap: 30px;
  padding-top: -20px;
}

.login-features .feature {
  display: flex;
  align-items: center;
  gap: 16px;
}

.login-features .feature i {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: rgba(22, 101, 255, 0.1);
  color: var(--primary);
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 20px;
}

.login-features .feature h4 {
  font-size: 16px;
  color: var(--text-primary);
}

.login-features .feature span {
  font-size: 14px;
  color: var(--text-muted);
}

.login-right {
  flex: .7;
  background: #ffffff;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 45px;
  border-left: 1px solid #e6ebf5;
}

.login-card {
  width: 100%;
  max-width: 380px;
  background: transparent;
  border-radius: 20px;
  padding: 0;
  animation: popup .5s ease;
}

.login-card h2 {
  text-align: center;
  color: var(--primary);
  font-size: 30px;

}

.login-card .subtitle {
  text-align: center;
  color: var(--text-muted);
  margin: 8px 0 28px;
}

.login-card .input-box {
  margin-bottom: 20px;
}

.login-card .input-box label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.login-card .input-field {
  display: flex;
  align-items: center;
  background: #f4f8f8;
  border: 2px solid transparent;
  border-radius: 12px;
  padding: 0 16px;
  height: 52px;
  transition: var(--transition);
}

.login-card .input-field:hover {
  border-color: var(--primary);
}

.login-card .input-field:focus-within {
  border-color: var(--primary);
  background: var(--bg-white);
  box-shadow: 0 0 0 4px rgba(22, 101, 255, 0.08);
}

.login-card .input-field i {
  color: var(--primary);
  font-size: 18px;
}

.login-card .input-field input,
.login-card .input-field select {
  width: 100%;
  border: none;
  outline: none;
  background: transparent;
  padding: 0 12px;
  font-size: 15px;
  color: var(--text-secondary);
}

.login-card .input-field select {
  cursor: pointer;
  appearance: none;
}

.login-card .login-btn {
  width: 100%;
  height: 52px;
  border: none;
  border-radius: 12px;
  background: var(--primary-gradient);
  color: #fff;
  font-size: 17px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  margin-top: 10px;
}

.login-card .login-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 15px 30px rgba(22, 101, 255, 0.35);
}

.login-card .login-btn i {
  margin-right: 10px;
}

.login-card .footer {
  text-align: center;
  margin-top: 25px;
  color: var(--text-muted);
  font-size: 14px;
}

@keyframes popup {
  from {
    transform: translateY(-40px) scale(0.95);
    opacity: 0;
  }
  to {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

@media (max-width: 1200px) {
  .cards {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .filter-section {
    flex-wrap: wrap;
  }
  
  .filter-box {
    min-width: 200px;
  }
}

@media (max-width: 992px) {
  .sidebar {
    width: var(--sidebar-collapsed);
    padding: 15px;
  }
  
  .sidebar .logo {
    margin: 0 0 30px 0;
    justify-content: center;
  }
  
  .sidebar .logo img {
    width: 60px;
    height: 60px;
  }
  
  .sidebar .logo h2,
  .sidebar .logo p,
  .sidebar ul li span,
  .sidebar-profile div {
    display: none;
  }
  
  .sidebar ul li {
    justify-content: center;
    padding: 14px;
  }
  
  .sidebar ul li i {
    font-size: 20px;
    width: auto;
  }
  
  .sidebar-profile {
    justify-content: center;
    padding: 12px;
  }
  
  .sidebar-profile img {
    width: 45px;
    height: 45px;
  }
  
  main {
    margin-left: var(--sidebar-collapsed);
    width: calc(100% - var(--sidebar-collapsed));
    padding: 20px;
  }
  
  header,
  .topbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 20px;
  }
  
  .right-header,
  .right {
    flex-wrap: wrap;
    width: 100%;
  }
  
  .search {
    width: 100%;
  }
  
  .details-grid {
    grid-template-columns: 1fr;
  }
  
  form {
    grid-template-columns: 1fr;
  }
  
  form .save-btn {
    grid-column: auto;
  }

  .login-container {
    flex-direction: column;
    height: auto;
    max-height: none;
    border-radius: 16px;
  }
  
  .login-left {
    width: 100%;
    padding: 30px;
    min-height: 250px;
  }
  
  .login-right {
    width: 100%;
    padding: 30px;
  }
  
  .login-card {
    padding: 30px;
  }
}

@media (max-width: 768px) {
  .sidebar {
    width: 60px;
    padding: 10px;
  }
  
  .sidebar .logo img {
    width: 40px;
    height: 40px;
  }
  
  .sidebar ul li {
    padding: 10px;
    margin-bottom: 6px;
  }
  
  .sidebar ul li i {
    font-size: 16px;
  }
  
  .sidebar-profile {
    padding: 8px;
  }
  
  .sidebar-profile img {
    width: 35px;
    height: 35px;
  }
  
  main {
    margin-left: 60px;
    width: calc(100% - 60px);
    padding: 15px;
  }
  
  .cards {
    grid-template-columns: 1fr;
  }
  
  .card {
    padding: 16px;
  }
  
  .card h2 {
    font-size: 24px;
  }
  
  .card i {
    width: 50px;
    height: 50px;
    font-size: 20px;
  }
  
  .table-container {
    overflow-x: auto;
  }
  
  .modal {
    padding: 12px;
  }

  .modal-content {
    width: 95% !important;
    max-width: 95vw !important;
    padding: 20px;
    box-sizing: border-box;
  }
  
  .top-actions {
    flex-direction: column;
  }
  
  .top-actions button {
    width: 100%;
    justify-content: center;
  }
  
  .filter-section {
    flex-direction: column;
  }
  
  .filter-box {
    width: 100%;
  }
  
  .filter-btn {
    width: 100%;
  }
  
  .pagination {
    justify-content: center;
    flex-wrap: wrap;
  }
  
  header h1,
  .topbar h1 {
    font-size: 28px;
  }
}

/* Small phones (~360-480px): cards were still full-height with desktop-sized
   text, and table cells kept their desktop padding/font so columns overflowed
   and got cut off, forcing an awkward horizontal squeeze instead of a clean
   scroll. Shrink both explicitly at this width. */
@media (max-width: 480px) {
  .cards {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .card {
    padding: 14px;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .card span {
    font-size: 12px;
  }

  .card h2 {
    font-size: 20px;
    margin: 4px 0;
  }

  .card p {
    font-size: 11px;
  }

  .card i {
    width: 42px;
    height: 42px;
    font-size: 18px;
    border-radius: 12px;
  }

  .welcome-section {
    padding: 18px;
  }

  .welcome-left h2 {
    font-size: 19px;
  }

  .panel {
    padding: 16px;
  }

  /* Table: keep it horizontally scrollable (don't force columns to squeeze),
     but shrink text/padding so more of each row is visible before scrolling,
     and enable smooth touch-scrolling on iOS/Android. */
  .table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  table {
    min-width: 640px; /* scrolls horizontally instead of crushing columns */
  }

  thead th {
    padding: 10px 12px;
    font-size: 12px;
    white-space: nowrap;
  }

  tbody td {
    padding: 10px 12px;
    font-size: 12px;
    white-space: nowrap;
  }

  .stock,
  .status,
  .role-badge {
    padding: 5px 10px;
    font-size: 11px;
  }
}

@media(max-width:1200px){
  .login-left{
    margin:auto;
  }
  .login-right{
    margin:auto;
  }
}

@media (max-width: 600px) {
  .login-left {
    display: none;
  }
  
  .login-right {
    padding: 20px;
    min-height: 100vh;
  }
  
  .login-card {
    padding: 24px;
  }
  
  .login-card h2 {
    font-size: 24px;
  }
  
  .login-container {
    height: 100vh;
    max-height: none;
    border-radius: 0;
  }
}

@media (max-width: 480px) {
  .sidebar {
    width: 50px;
    padding: 8px;
  }
  .sidebar ul li a{ margin-left:-1px;
  padding-left: 0px;}
  .sidebar ul li.active a{
  background:var(--primary-gradient);
  color:#fff;
  box-shadow:0 15px 28px rgba(22,101,255,.28);
  width: 30px;
  height :30px;
  padding:2px 2px 2px 2px;
  border-radius:50%
  }
  
  .sidebar .logo img {
    width: 32px;
    height: 32px;
  }
  
  .sidebar ul li {
    padding: 8px;
  }
  
  .sidebar ul li i {
    font-size: 14px;
  }
  
  main {
    margin-left: 50px;
    width: calc(100% - 50px);
    padding: 10px;
  }
  
  .profile {
    display: none;
  }
  
  .right-header button,
  .topbar button {
    width: 40px;
    height: 40px;
    font-size: 14px;
  }
  
  header h1,
  .topbar h1 {
    font-size: 22px;
  }

  .modal {
    padding: 8px;
  }

  .modal-content {
    width: 100% !important;
    max-width: 100vw !important;
    padding: 16px;
  }
}

.welcome-section {
  background: var(--bg-white);
  border-radius: var(--radius-xl);
  padding: 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: var(--shadow-sm);
  margin-bottom: 25px;
}

.welcome-left h2 {
  color: var(--text-primary);
  font-size: 24px;
}

.welcome-left p {
  color: var(--text-muted);
  margin-top: 4px;
}

.date-box {
  border: 1px solid #e7ebf2;
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  display: flex;
  gap: 10px;
  align-items: center;
}

.date-box i {
  color: var(--primary);
}

.date-box span {
  font-weight: 500;
}

.card-icon-blue {
  background: #edf3ff !important;
  color: #2563eb !important;
}

.card-icon-green {
  background: #e9fff0 !important;
  color: #22c55e !important;
}

.card-icon-purple {
  background: #f3ecff !important;
  color: #7c3aed !important;
}

.card-icon-orange {
  background: #fff4e5 !important;
  color: #f59e0b !important;
}

/* Text Colors */
.text-success {
  color: #22c55e;
}

.text-warning {
  color: #f59e0b;
}

.text-danger {
  color: #d62828;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 25px;
}

.dashboard-right {
  display: flex;
  flex-direction: column;
  gap: 25px;
}

.panel {
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-top:20px;
  box-shadow: var(--shadow-sm);
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.panel-header h3 {
  color: var(--text-primary);
  font-size: 18px;
}

.view-all-btn {
  background: var(--bg-hover);
  color: var(--primary);
  padding: 8px 16px;
  border-radius: 10px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.view-all-btn:hover {
  background: var(--primary);
  color: #fff;
}

.order-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 0;
  border-bottom: 1px solid #edf1f7;
}


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

.order-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.order-icon {
  width: 48px;
  height: 48px;
  background: var(--bg-hover);
  color: var(--primary);
  border-radius: var(--radius-sm);
  display: flex;
  justify-content: center;
  align-items: center;
  flex-shrink: 0;
}

.order-left h4 {
  font-size: 14px;
  color: var(--text-primary);
}

.order-left p {
  font-size: 13px;
  color: var(--text-muted);
}

.order-item strong {
  color: var(--text-primary);
}

.inventory-status {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.inventory-item {
  width: 100%;
}

.inventory-head {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
}

.inventory-head div {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--text-secondary);
}

.inventory-head strong {
  color: var(--text-primary);
}

.progress-bar {
  width: 100%;
  height: 10px;
  background: #edf2f7;
  border-radius: 20px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 20px;
  transition: width 1s ease;
}

.progress-fill.green {
  background: #22c55e;
}

.progress-fill.orange {
  background: #f59e0b;
}

.progress-fill.red {
  background: #d62828;
}

.inventory-item small {
  display: block;
  margin-top: 4px;
  color: var(--text-muted);
  font-size: 12px;
}

.service-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid #edf1f7;
}

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

.service-item h4 {
  font-size: 14px;
  color: var(--text-primary);
}

.service-item p {
  font-size: 13px;
  color: var(--text-muted);
}


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

@media (max-width: 992px) {
  .welcome-section {
    flex-direction: column;
    align-items: flex-start;
    gap: 15px;
  }
  
  .dashboard-right {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .order-item {
    flex-wrap: wrap;
    gap: 10px;
  }
  
  .order-item strong {
    margin-left: auto;
  }
  
  .service-item {
    flex-wrap: wrap;
    gap: 10px;
  }
}
/* Logout Modal */

.logout-modal{
    position:fixed;
    inset:0;
    background:rgba(0,0,0,.45);
    display:none;
    justify-content:center;
    align-items:center;
    z-index:9999;
}

.logout-modal.active{
    display:flex;
}

.logout-box{

    width:380px;

    background:#fff;

    border-radius:20px;

    padding:35px;

    text-align:center;

    animation:popup .3s ease;
}

.logout-icon{

    width:75px;

    height:75px;

    border-radius:50%;

    background:#edf4ff;

    color:var(--primary);

    display:flex;

    justify-content:center;

    align-items:center;

    font-size:30px;

    margin:auto auto 20px;
}

.logout-box h2{

    color:var(--text-primary);

    margin-bottom:12px;
}

.logout-box p{

    color:var(--text-muted);

    line-height:1.6;
}

.logout-actions{

    margin-top:30px;

    display:flex;

    gap:15px;
}

.logout-actions button{

    flex:1;

    padding:13px;

    border:none;

    border-radius:12px;

    font-weight:600;

    cursor:pointer;

    transition:.3s;
}

.cancel-btn{

    background:#eef2f7;

    color:#444;
}

.cancel-btn:hover{

    background:#dde5ef;
}

.confirm-btn{

    background:#d62828;

    color:#fff;
}

.confirm-btn:hover{

    background:#b91c1c;
}

.action-box{

    width:360px;

}

.action-btn{

    width:100%;

    margin-bottom:15px;

    border:none;

    padding:13px;

    border-radius:10px;

    color:#fff;

    cursor:pointer;

    font-size:15px;

}

.action-btn.blue{

    background:#1665ff;

}

.action-btn.green{

    background:#16a34a;

}

.manager-box{

    width:430px;

}

.manager-box select,

.manager-box textarea{

    width:100%;

    margin-top:8px;

    margin-bottom:18px;

    padding:10px;

    border-radius:8px;

    border:1px solid #ddd;

    font-size:14px;

}

.manager-box label{

    font-weight:600;

}