@charset "UTF-8";

/* ========================================================
   GOLMOTI MAKHANA MANAGEMENT SYSTEM - CORE STYLESHEET
   Deep Green: #124B0B | Cream: #F3E8C8 | Light Surface: #FAF8F5
   ======================================================== */

:root {
  --brand-primary: #124B0B;
  --brand-primary-hover: #0D3807;
  --brand-primary-light: #19630F;
  --brand-cream: #F3E8C8;
  --brand-cream-light: #FAF6EE;
  --brand-cream-surface: #FDFBF7;
  --brand-border: #E8E2D2;
  --brand-border-dark: #1D361D;
  --brand-dark: #122212;
  --brand-dark-sidebar: #0E1B0E;
  --brand-dark-surface: #163316;
  --text-main: #1C1917;
  --text-muted: #78716C;
  --bg-main: #FAF8F5;
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

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

html, body {
  height: 100%;
  font-family: var(--font-sans);
  background-color: var(--bg-main);
  color: var(--text-main);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.font-mono, .tabular-nums {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

/* Layout Container */
.app-container {
  display: flex;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
}

/* Sidebar */
.sidebar {
  width: 260px;
  background-color: var(--brand-dark);
  color: #D6D3D1;
  border-right: 1px solid var(--brand-border-dark);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  user-select: none;
  z-index: 30;
}

.sidebar-header {
  height: 64px;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--brand-border-dark);
  background-color: var(--brand-dark-sidebar);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand-emblem {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background-color: var(--brand-cream);
  color: var(--brand-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 13px;
  border: 1px solid #E2D4A8;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.brand-title {
  display: flex;
  flex-direction: column;
}

.brand-title .title {
  font-weight: 800;
  letter-spacing: 0.05em;
  color: var(--brand-cream);
  font-size: 15px;
  line-height: 1.1;
}

.brand-title .sub {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.15em;
  color: #A8A29E;
  text-transform: uppercase;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 16px 12px;
}

.nav-group {
  margin-bottom: 20px;
}

.nav-group-title {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: #8F9E8F;
  text-transform: uppercase;
  padding: 4px 12px;
  margin-bottom: 4px;
}

.nav-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-radius: 8px;
  color: #D6D3D1;
  text-decoration: none;
  font-size: 12px;
  font-weight: 600;
  transition: all 0.15s ease;
  margin-bottom: 2px;
}

.nav-link:hover {
  background-color: #1A311A;
  color: #FFFFFF;
}

.nav-link.active {
  background-color: var(--brand-primary);
  color: var(--brand-cream);
  box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.nav-link-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-badge {
  font-family: var(--font-mono);
  font-size: 9px;
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid rgba(255,255,255,0.15);
  color: #A8A29E;
}

.nav-link.active .nav-badge {
  background: rgba(243, 232, 200, 0.2);
  border-color: transparent;
  color: var(--brand-cream);
}

.sidebar-footer {
  padding: 14px;
  border-top: 1px solid var(--brand-border-dark);
  background-color: rgba(14, 27, 14, 0.8);
}

.system-badge {
  padding: 10px 12px;
  background-color: #142A14;
  border: 1px solid #214221;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Main Canvas */
.main-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  height: 100%;
  overflow: hidden;
}

/* Header */
.top-header {
  height: 64px;
  padding: 0 28px;
  background-color: #FFFFFF;
  border-bottom: 1px solid var(--brand-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  z-index: 20;
}

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

.header-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--brand-dark);
  letter-spacing: -0.01em;
}

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

.status-beacon {
  display: flex;
  align-items: center;
  gap: 8px;
  background-color: var(--brand-cream-light);
  border: 1px solid var(--brand-border);
  padding: 4px 10px;
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: #57534E;
}

.dot-pulse {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: #16A34A;
}

.admin-profile {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-left: 12px;
  border-left: 1px solid #E7E5E4;
}

.avatar-badge {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background-color: var(--brand-primary);
  color: var(--brand-cream);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 12px;
}

.logout-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  color: #57534E;
  text-decoration: none;
  border-radius: 8px;
  border: 1px solid transparent;
  transition: all 0.15s ease;
  cursor: pointer;
  background: none;
}

.logout-btn:hover {
  background-color: #FEF2F2;
  color: #DC2626;
  border-color: #FECACA;
}

/* Content Area */
.content-area {
  flex: 1;
  overflow-y: auto;
  padding: 24px 28px;
  background-color: var(--bg-main);
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.content-max {
  width: 100%;
  max-width: 100%;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
  box-sizing: border-box;
}

/* Hero Card */
.hero-banner {
  background: linear-gradient(135deg, #122212 0%, #163316 60%, #0E1F0E 100%);
  border: 1px solid var(--brand-border-dark);
  border-radius: 16px;
  padding: 28px 32px;
  color: #FFFFFF;
  position: relative;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 6px;
  background-color: #193519;
  border: 1px solid #264D26;
  color: #E0D3B0;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  margin-bottom: 12px;
}

.hero-title {
  font-size: 26px;
  font-weight: 800;
  color: var(--brand-cream);
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin-bottom: 8px;
}

.hero-desc {
  font-size: 14px;
  color: #D6D3D1;
  max-width: 680px;
  line-height: 1.6;
  margin-bottom: 24px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.btn-hero-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  background-color: var(--brand-cream);
  color: var(--brand-primary);
  font-weight: 700;
  font-size: 12px;
  border-radius: 10px;
  text-decoration: none;
  border: none;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
  transition: background-color 0.15s ease;
}

.btn-hero-primary:hover {
  background-color: #E8DCB8;
}

.btn-hero-secondary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  background-color: #1B3E18;
  color: #FFFFFF;
  border: 1px solid #2E632A;
  font-weight: 600;
  font-size: 12px;
  border-radius: 10px;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.btn-hero-secondary:hover {
  background-color: #235020;
}

/* KPI Cards Grid */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

.kpi-card {
  background-color: #FFFFFF;
  border: 1px solid var(--brand-border);
  border-radius: 12px;
  padding: 16px 18px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.02);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  position: relative;
  overflow: visible;
  min-width: 0;
  gap: 10px;
}

.kpi-card > div:first-child {
  min-width: 0;
  flex: 1;
}

.kpi-card.highlight {
  border-color: rgba(18, 75, 11, 0.3);
  background: linear-gradient(135deg, #FFFFFF 0%, #FAF8F3 100%);
}

.kpi-card.highlight::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background-color: var(--brand-primary);
}

.kpi-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-bottom: 6px;
  line-height: 1.2;
}

.kpi-value-row {
  display: flex;
  align-items: baseline;
  gap: 6px;
  flex-wrap: wrap;
  padding-top: 2px;
}

.kpi-value {
  font-size: 21px;
  font-weight: 800;
  color: var(--brand-dark);
  line-height: 1.25;
  word-break: normal;
  white-space: nowrap;
}

.kpi-unit {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
}

.kpi-sub {
  font-size: 11px;
  color: #78716C;
  margin-top: 4px;
  line-height: 1.3;
}

.kpi-icon {
  padding: 8px 10px;
  border-radius: 8px;
  background-color: var(--brand-cream-light);
  color: var(--brand-primary);
  border: 1px solid rgba(232, 226, 210, 0.8);
  font-size: 16px;
  flex-shrink: 0;
}

/* Card & Tables */
.content-card {
  background-color: #FFFFFF;
  border: 1px solid var(--brand-border);
  border-radius: 14px;
  padding: 24px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.02);
}

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

.card-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--brand-dark);
}

.card-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Responsive Table */
.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  text-align: left;
}

.data-table th {
  padding: 10px 14px;
  border-bottom: 1px solid #E7E5E4;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #78716C;
}

.data-table td {
  padding: 14px;
  border-bottom: 1px solid #F5F5F4;
  color: #292524;
}

.data-table tr:hover td {
  background-color: #FAF8F5;
}

/* Dedicated Lot Costing Table */
.table-scroll-container {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 12px;
}

.lot-costing-table {
  width: 100%;
  min-width: 1060px;
  border-collapse: collapse;
  text-align: left;
  font-size: 13px;
}

.lot-costing-table th {
  padding: 13px 16px;
  background-color: #FAF8F3;
  border-bottom: 1px solid #E8E2D2;
  color: #57534E;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.lot-costing-table td {
  padding: 14px 16px;
  border-bottom: 1px solid #F5F2EB;
  vertical-align: middle;
  white-space: nowrap;
}

.lot-costing-table tr:hover td {
  background-color: #FAF9F5;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 44px 20px;
  border-radius: 12px;
  border: 1px dashed #DDD7C5;
  background-color: #FAF8F3;
}

.empty-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 14px;
  border-radius: 50%;
  background-color: rgba(243, 232, 200, 0.6);
  color: var(--brand-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #E2D4A8;
}

.empty-title {
  font-size: 15px;
  font-weight: 800;
  color: var(--brand-dark);
  margin-bottom: 6px;
}

.empty-desc {
  font-size: 13px;
  color: #78716C;
  max-width: 440px;
  margin: 0 auto 20px;
  line-height: 1.5;
}

/* Tabs */
.tabs-bar {
  display: flex;
  gap: 4px;
  padding: 4px;
  background-color: #F0EBE0;
  border-radius: 10px;
  border: 1px solid #DDD7C5;
  overflow-x: auto;
}

.tab-btn {
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  color: #57534E;
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  border: none;
  background: none;
  cursor: pointer;
  transition: all 0.15s ease;
}

.tab-btn.active {
  background-color: #FFFFFF;
  color: var(--brand-primary);
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

/* Forms */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

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

.form-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #44403C;
}

.form-input, .form-textarea {
  width: 100%;
  padding: 10px 14px;
  font-size: 13px;
  border-radius: 10px;
  border: 1px solid #DDD7C5;
  background-color: #FFFFFF;
  font-family: inherit;
  color: #1C1917;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-input:focus, .form-textarea:focus {
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px rgba(18, 75, 11, 0.12);
}

/* Buttons */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background-color: var(--brand-primary);
  color: var(--brand-cream);
  font-weight: 700;
  font-size: 12px;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

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

/* Login Screen */
.login-split {
  display: flex;
  min-height: 100vh;
  width: 100%;
}

.login-left {
  flex: 1;
  background-color: var(--brand-dark);
  padding: 50px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border-right: 1px solid var(--brand-border-dark);
}

.login-right {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  background-color: var(--bg-main);
  min-width: 0;
}

.login-card {
  width: 100%;
  max-width: 440px;
  background-color: #FFFFFF;
  border: 1px solid var(--brand-border);
  border-radius: 16px;
  padding: 36px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.03);
  box-sizing: border-box;
}

.desktop-only {
  display: inline-flex;
  align-items: center;
}

@media (max-width: 1024px) {
  .desktop-only {
    display: none !important;
  }
}

/* Mobile & Tablet Responsiveness (<= 1024px) */
.mobile-menu-btn {
  display: none;
  padding: 8px;
  background: none;
  border: none;
  cursor: pointer;
  color: #44403C;
}

@media (max-width: 1024px) {
  .login-split {
    flex-direction: column;
    min-height: 100vh;
    width: 100%;
  }

  .login-left {
    display: none !important;
  }

  .login-mobile-brand {
    display: flex !important;
  }

  .login-right {
    width: 100%;
    flex: 1;
    padding: 30px 16px;
    min-height: 100vh;
  }

  .login-card {
    padding: 24px 20px;
    margin: auto;
  }

  .mobile-menu-btn {
    display: block;
  }

  .status-beacon {
    display: none;
  }

  .sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: -280px;
    transition: left 0.25s ease;
    z-index: 50;
  }

  .sidebar.open {
    left: 0;
  }

  .top-header {
    padding: 0 16px;
  }

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

/* Mobile Screens (<= 640px) */
@media (max-width: 640px) {
  .top-header {
    height: 56px;
    padding: 0 12px;
  }

  .header-left {
    gap: 8px;
    min-width: 0;
    flex: 1;
  }

  .header-title {
    font-size: 15px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 180px;
  }

  .header-right {
    gap: 8px;
    flex-shrink: 0;
  }

  .admin-profile {
    padding-left: 6px;
    border-left: none;
  }

  .admin-profile > div:last-child {
    display: none;
  }

  .avatar-badge {
    width: 28px;
    height: 28px;
    font-size: 11px;
  }

  .logout-btn .desktop-only {
    display: none;
  }

  .logout-btn {
    padding: 6px 8px;
  }

  .kpi-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .form-grid {
    grid-template-columns: 1fr !important;
    gap: 14px;
  }

  .content-card {
    padding: 16px 14px;
  }

  .card-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .table-responsive {
    -webkit-overflow-scrolling: touch;
    border-radius: 10px;
    border: 1px solid #E7E5E4;
  }

  .data-table {
    min-width: 650px;
  }

  .modal-dialog {
    width: 95% !important;
    margin: 16px auto !important;
    padding: 18px 16px !important;
  }

  .btn-primary, .btn-secondary {
    width: 100%;
    justify-content: center;
  }

  .btn-group-responsive {
    display: flex;
    flex-direction: column-reverse;
    gap: 8px;
    width: 100%;
  }
}

@media (min-width: 641px) and (max-width: 1024px) {
  .kpi-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
  }

  .form-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 16px;
  }

  .table-responsive {
    -webkit-overflow-scrolling: touch;
  }

  .data-table {
    min-width: 750px;
  }
}

@media (min-width: 1025px) and (max-width: 1400px) {
  .kpi-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
  }
}

@media (min-width: 1401px) {
  .kpi-grid {
    grid-template-columns: repeat(6, 1fr);
    gap: 16px;
  }
}

/* ========================================================
   GLOBAL PRINT RULES (A4 Optimized)
   ======================================================== */
@media print {
  .sidebar,
  .top-header,
  .mobile-menu-btn,
  .content-header .btn-primary,
  .content-header .btn-secondary,
  .no-print {
    display: none !important;
  }
  .print-only {
    display: block !important;
  }
  span.print-only {
    display: inline !important;
  }
  .app-container {
    display: block !important;
    height: auto !important;
    width: 100% !important;
    overflow: visible !important;
  }
  .main-wrapper {
    display: block !important;
    height: auto !important;
    overflow: visible !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
  }
  .content-area,
  .content-max {
    display: block !important;
    overflow: visible !important;
    height: auto !important;
    width: 100% !important;
    max-width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
  }
}


