/* style.css - Clean Windows Desktop UI with Vertical Sidebar Menu */

/* 1. Google Fonts for Crisp Marathi / Devanagari Typography */
@import url('https://fonts.googleapis.com/css2?family=Mukta:wght@400;500;600;700;800&family=Noto+Sans+Devanagari:wght@400;500;600;700;800;900&family=Poppins:wght@400;500;600;700&display=swap');

/* 2. Embedded Legacy Shivaji Fonts for Desktop Compatibility */
@font-face {
  font-family: 'SHIV01';
  src: url('SHIV01.TTF') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Shivaji';
  src: url('SHIV01.TTF') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Shivaji01';
  src: url('SHIV01.TTF') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'SHIV02';
  src: url('SHIV02.TTF') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Shivaji02';
  src: url('SHIV02.TTF') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'SHIV05';
  src: url('SHIV05.TTF') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Shivaji05';
  src: url('SHIV05.TTF') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg-desktop: #dce7f3;
  --bg-panel: #f4f8fb;
  --border-dark: #000080;
  --text-dark: #111111;
  --text-title: #002b66;
  --marathi-font-stack: 'Noto Sans Devanagari', 'Mukta', 'Poppins', 'Nirmala UI', 'Mangal', 'Segoe UI', Arial, sans-serif;
}

*, html, body, button, input, select, textarea, table, th, td, h1, h2, h3, h4, h5, h6, label, span, p, a, div {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: var(--marathi-font-stack);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

input, select, textarea, button, optgroup, option {
  font-family: var(--marathi-font-stack) !important;
}

body {
  background-color: var(--bg-desktop);
  color: var(--text-dark);
  min-height: 100vh;
}

/* WinForms Action Toolbar (हुबेहूब डेस्कटॉप सॉफ्टवेअर प्रमाणे) */
.win-action-toolbar {
  background-color: #c5dcf5;
  border: 1px solid #78909c;
  padding: 8px 15px;
  margin-top: 20px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  border-radius: 2px;
}

.win-btn-action {
  background: linear-gradient(to bottom, #1e7e34 0%, #145a23 100%);
  color: #ffffff !important;
  border: 2px solid #000080;
  padding: 5px 18px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  border-radius: 2px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 85px;
  height: 34px;
  box-shadow: 1px 1px 3px rgba(0,0,0,0.3);
  transition: all 0.1s ease;
}

.win-btn-action:hover {
  background: linear-gradient(to bottom, #2e7d32 0%, #1a6320 100%);
  border: 2px solid #ffff00 !important;
  box-shadow: 0 0 5px #ffff00;
}

/* Sub Tab Link Bar (अलग-अलग स्पष्ट बटन्स - Separate Proper Tab Buttons) */
.sub-tab-bar {
  background: linear-gradient(to bottom, #dbe7f3 0%, #c5dcf5 100%);
  border: 1.5px solid #5c7e9d;
  padding: 8px 14px;
  margin-bottom: 15px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  border-radius: 4px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}

.sub-tab-link, .top-sub-link {
  background: linear-gradient(to bottom, #ffffff 0%, #edf3fa 100%);
  color: #002b66 !important;
  border: 1.5px solid #799ec8;
  padding: 6px 16px;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none !important;
  cursor: pointer;
  letter-spacing: 0.2px;
  border-radius: 3px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 1px 1px 3px rgba(0,0,0,0.12);
  transition: all 0.15s ease;
}

.sub-tab-link:hover, .top-sub-link:hover {
  background: linear-gradient(to bottom, #2e7d32 0%, #1a6320 100%);
  color: #ffffff !important;
  border-color: #000080;
  box-shadow: 0 0 5px rgba(0,0,128,0.3);
}

.sub-tab-link.active-tab, .top-sub-link.active-tab {
  background: linear-gradient(to bottom, #1565c0 0%, #0d47a1 100%);
  color: #ffffff !important;
  border-color: #000080 !important;
  box-shadow: 0 2px 6px rgba(13,71,161,0.35);
}

/* App Layout Container - Vertical Sidebar Layout */
.app-layout {
  display: flex;
  min-height: 100vh;
  background-color: var(--bg-desktop);
}

/* Vertical Sidebar Menu (उभा मेनू - Left Vertical Sidebar) */
.sidebar-menu {
  width: 250px;
  background: linear-gradient(to bottom, #dbe7f3 0%, #c5dcf5 100%);
  border-right: 2px solid #5c7e9d;
  display: flex;
  flex-direction: column;
  box-shadow: 3px 0 10px rgba(0,0,0,0.15);
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.sidebar-brand {
  background: linear-gradient(to right, #356299, #1f3b5e);
  color: #ffffff;
  padding: 12px 14px;
  border-bottom: 2px solid #000080;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
}

.brand-logo-img {
  width: 34px;
  height: 34px;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

.brand-name {
  font-size: 19px;
  font-weight: 900;
  letter-spacing: 0.5px;
}

/* Top Status Bar */
.top-status-bar {
  background: linear-gradient(to right, #356299, #1f3b5e);
  color: #ffffff;
  padding: 8px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid #000080;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.system-title {
  font-size: 14px;
  font-weight: bold;
  letter-spacing: 0.3px;
}

.logged-user-info {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 13px;
}

.logged-user-info strong {
  color: #ffff00;
  font-size: 14px;
}

/* Vertical Menu List (100% Exact Screenshot Match) */
.v-menu-list {
  padding: 10px 8px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  flex-grow: 1;
}

.v-menu-btn {
  background: linear-gradient(to bottom, #166f2b 0%, #0d4a1b 100%);
  color: #ffffff !important;
  border: 2px solid #000080;
  padding: 8px 10px;
  min-height: 40px;
  font-size: 15.5px;
  font-weight: 700;
  text-decoration: none !important;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
  border-radius: 2px;
  cursor: pointer;
  letter-spacing: 0.2px;
  text-shadow: 0 1px 2px rgba(0,0,0,0.8);
  transition: all 0.1s ease-in-out;
}

/* Blue Button for Ledger (नवीन खाते तयार करा - exact screenshot match) */
.v-menu-ledger {
  background: linear-gradient(to bottom, #0056b3 0%, #003366 100%) !important;
  border: 2px solid #000080 !important;
}

.v-menu-ledger:hover, .v-menu-ledger.active {
  background: linear-gradient(to bottom, #0069d9 0%, #004085 100%) !important;
  border: 2.5px solid #d4f800 !important;
  box-shadow: 0 0 8px rgba(212, 248, 0, 0.75), inset 0 0 3px rgba(255,255,255,0.2) !important;
}

/* Active Menu Button / Hover (Glowing Yellow/Gold Border - 100% exact screenshot match) */
.v-menu-btn.active, .v-menu-btn:hover {
  background: linear-gradient(to bottom, #1d8335 0%, #0e521e 100%);
  border: 2.5px solid #d4f800 !important;
  box-shadow: 0 0 8px rgba(212, 248, 0, 0.8), inset 0 0 3px rgba(255,255,255,0.2) !important;
}

/* Special Accent Borders (Exact Screenshot Match) */
.v-menu-saving {
  border-left: 6px solid #ff9900 !important;
}

.v-menu-stock {
  border-left: 6px solid #0056b3 !important;
}

.v-menu-validity {
  border-left: 6px solid #10b981 !important;
}

.v-menu-logout {
  background: linear-gradient(to bottom, #c62828 0%, #8e0000 100%) !important;
  border: 2px solid #500000 !important;
}
.v-menu-logout:hover {
  background: linear-gradient(to bottom, #e53935 0%, #b71c1c 100%) !important;
  border: 2px solid #ffff00 !important;
}

.sidebar-footer {
  padding: 10px 8px;
  border-top: 1px solid #78909c;
  background: #c5dcf5;
}

/* Right Content Body Area */
.content-body {
  flex-grow: 1;
  min-width: 0;
}

/* Main Container Area */
.main-wrapper {
  padding: 20px;
}

.win-panel {
  background-color: var(--bg-panel);
  border: 2px solid #5c7e9d;
  border-radius: 4px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  margin-bottom: 20px;
  overflow: hidden;
}

.win-panel-header {
  background: linear-gradient(to right, #356299, #4a7ebb);
  color: #ffffff;
  padding: 10px 16px;
  font-size: 17px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.win-panel-body {
  padding: 20px;
}

.page-title {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-title);
  margin-bottom: 4px;
}

.page-subtitle {
  font-size: 13px;
  font-weight: 600;
  color: #4a6572;
  margin-bottom: 15px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 15px;
}

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

.form-group.span-2 { grid-column: span 2; }
.form-group.span-3 { grid-column: span 3; }
.form-group.span-full { grid-column: 1 / -1; }

.form-group label {
  font-size: 14px;
  font-weight: 700;
  color: #003366;
}

.form-control {
  background-color: #ffffff;
  border: 1px solid #799ec8;
  color: #000000;
  padding: 7px 10px;
  border-radius: 3px;
  font-size: 14px;
  font-weight: 600;
  outline: none;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 18px;
  border-radius: 3px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid #000000;
  text-decoration: none;
  box-shadow: 1px 1px 3px rgba(0,0,0,0.2);
}

.btn-primary { background: linear-gradient(to bottom, #1565c0, #0d47a1); color: #ffffff; }
.btn-success { background: linear-gradient(to bottom, #2e7d32, #1b5e20); color: #ffffff; }
.btn-warning { background: linear-gradient(to bottom, #f59e0b, #d97706); color: #000000; }
.btn-danger { background: linear-gradient(to bottom, #c62828, #8e0000); color: #ffffff; }
.btn-sm { padding: 4px 10px; font-size: 12px; }

.table-responsive { width: 100%; overflow-x: auto; }

.custom-table {
  width: 100%;
  border-collapse: collapse;
  background-color: #ffffff;
  border: 1px solid #799ec8;
  font-size: 14px;
}

.custom-table th {
  background: linear-gradient(to bottom, #356299 0%, #254770 100%);
  color: #ffffff;
  font-weight: 700;
  padding: 9px 12px;
  border: 1px solid #1f3b5e;
  text-align: left;
}

.custom-table td {
  padding: 8px 12px;
  border: 1px solid #c4d6ea;
  color: #000000;
}

.custom-table tbody tr:nth-child(even) { background-color: #f2f7fc; }
.custom-table tbody tr:hover { background-color: #d9e8f7; }

.badge { padding: 3px 8px; border-radius: 3px; font-size: 12px; font-weight: 700; display: inline-block; }
.badge-success { background-color: #e8f5e9; color: #1b5e20; border: 1px solid #a5d6a7; }
.badge-primary { background-color: #e3f2fd; color: #0d47a1; border: 1px solid #90caf9; }
.badge-warning { background-color: #fff8e1; color: #b45309; border: 1px solid #ffe082; }
.badge-danger { background-color: #ffebee; color: #b71c1c; border: 1px solid #ef9a9a; }

.alert { padding: 10px 15px; border-radius: 4px; margin-bottom: 15px; font-size: 14px; font-weight: 700; }
.alert-success { background-color: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.alert-danger { background-color: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }

/* ==========================================================================
/* ==========================================================================
   MOBILE VIEW & PROGRESSIVE WEB APP (PWA) RESPONSIVE STYLES
   ========================================================================== */

/* Mobile App Header (Visible on Mobile < 768px) */
.mobile-app-header {
  display: none;
  background: linear-gradient(to right, #1f3b5e, #356299);
  color: #ffffff;
  padding: 8px 12px;
  align-items: center;
  justify-content: space-between;
  border-bottom: 2px solid #000080;
  position: sticky;
  top: 0;
  z-index: 1050;
  box-shadow: 0 2px 8px rgba(0,0,0,0.25);
}

.mobile-menu-toggle {
  background: #166f2b;
  border: 1.5px solid #d4f800;
  color: #ffffff;
  font-size: 20px;
  line-height: 1;
  width: 40px;
  height: 38px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 5px rgba(0,0,0,0.3);
}

.mobile-brand-title {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.3px;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 8px;
}

.mobile-brand-title img {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

/* Sidebar Backdrop Overlay on Mobile */
.sidebar-backdrop {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(2px);
  z-index: 1090;
  opacity: 0;
  transition: opacity 0.25s ease-in-out;
}

.sidebar-backdrop.active {
  display: block;
  opacity: 1;
}

/* Close Drawer Button inside Sidebar (Mobile only) */
.sidebar-close-btn {
  display: none;
  background: #c62828;
  color: #ffffff;
  border: 1px solid #ffffff;
  border-radius: 3px;
  padding: 4px 10px;
  font-size: 13px;
  font-weight: bold;
  cursor: pointer;
  margin-left: auto;
}

/* Mobile Bottom Navigation Bar */
.mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, #111827, #1f2937);
  border-top: 2px solid #3b82f6;
  z-index: 1040;
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom, 0px)) 4px;
  box-shadow: 0 -3px 12px rgba(0,0,0,0.35);
  justify-content: space-around;
  align-items: center;
}

.mob-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #cbd5e1;
  text-decoration: none !important;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 6px;
  transition: all 0.15s ease;
  min-width: 58px;
  gap: 2px;
}

.mob-nav-item .mob-icon {
  font-size: 18px;
  line-height: 1;
}

.mob-nav-item.active, .mob-nav-item:hover {
  color: #ffff00;
  background: rgba(255, 255, 255, 0.12);
}

.mob-nav-item.active .mob-icon {
  transform: scale(1.15);
}

/* PWA App Install Banner */
.pwa-install-banner {
  display: none;
  position: fixed;
  bottom: 68px;
  left: 12px;
  right: 12px;
  background: linear-gradient(135deg, #1e3a8a, #0d47a1);
  color: #ffffff;
  padding: 10px 14px;
  border-radius: 8px;
  border: 1.5px solid #60a5fa;
  box-shadow: 0 8px 24px rgba(0,0,0,0.35);
  z-index: 1060;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.pwa-btn-install {
  background: #16a34a;
  color: #ffffff;
  border: 1.5px solid #d4f800;
  padding: 6px 14px;
  border-radius: 4px;
  font-size: 13px;
  font-weight: bold;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0,0,0,0.25);
  white-space: nowrap;
}

.pwa-btn-close {
  background: transparent;
  color: #94a3b8;
  border: none;
  font-size: 18px;
  cursor: pointer;
  padding: 0 4px;
}

/* Responsive Media Queries for Mobile & Tablets */
@media (max-width: 768px) {
  .mobile-app-header {
    display: flex !important;
  }

  .mobile-bottom-nav {
    display: flex !important;
  }

  .sidebar-close-btn {
    display: inline-block !important;
  }

  .app-layout {
    flex-direction: column !important;
    min-height: 100vh !important;
  }

  .sidebar-menu {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    bottom: 0 !important;
    height: 100vh !important;
    z-index: 1100 !important;
    transform: translateX(-100%) !important;
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1) !important;
    box-shadow: 5px 0 25px rgba(0,0,0,0.4) !important;
    width: 285px !important;
    max-width: 85vw !important;
  }

  .sidebar-menu.open {
    transform: translateX(0) !important;
  }

  .top-status-bar {
    display: none !important;
  }

  .main-wrapper {
    padding: 8px 6px 85px 6px !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  .content-body {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: hidden !important;
  }

  /* Box Containers & Panels */
  .win-purchase-box, .win-sales-box, .win-box-container, .win-box, .win-panel, .win-panel-body, .panel-body {
    padding: 10px 8px !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  /* Sub Tab & Navigation Bars */
  .sub-tab-bar, .win-action-toolbar, .top-action-bar {
    padding: 6px 8px !important;
    gap: 6px !important;
    flex-wrap: wrap !important;
    justify-content: stretch !important;
  }

  .sub-tab-link, .top-sub-link, .win-btn-action, .btn-action {
    flex: 1 1 calc(50% - 6px) !important;
    min-height: 40px !important;
    font-size: 13.5px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    margin-right: 0 !important;
  }

  /* Form Grids & Inputs */
  .form-grid {
    grid-template-columns: 1fr !important;
    gap: 8px !important;
  }

  .form-group.span-2, .form-group.span-3, .form-group.span-full {
    grid-column: 1 / -1 !important;
  }

  .win-p-input, .form-control, select, input[type="text"], input[type="number"], input[type="date"] {
    font-size: 14.5px !important;
    min-height: 38px !important;
    box-sizing: border-box !important;
  }

  /* Responsive Horizontal Flex Rows */
  form div[style*="display: flex"], form div[style*="display:flex"] {
    flex-wrap: wrap !important;
    gap: 8px !important;
  }

  /* Responsive DataGrid & Tables with Touch Scrolling */
  .grid-view-wrapper, .table-responsive, .ledger-grid-wrapper {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    border: 1px solid #78909c !important;
    margin-top: 6px !important;
  }

  .win-exact-datagrid, .custom-table, .javak-grid-table, .aavak-grid-table {
    min-width: 680px !important;
    font-size: 12.5px !important;
  }

  .win-exact-datagrid th, .win-exact-datagrid td,
  .custom-table th, .custom-table td {
    padding: 6px 8px !important;
    white-space: nowrap !important;
  }

  /* Modal Panels */
  .modal-dialog, .modal-win-panel, .modal-admin-card {
    width: 95% !important;
    max-width: 95% !important;
    margin: 10px auto !important;
    padding: 12px !important;
  }
}



