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

:root {
  --primary-color: #10b981; /* Emerald Green */
  --primary-hover: #059669;
  --bg-dark: #0f172a;
  --bg-panel: rgba(30, 41, 59, 0.7);
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --border-color: rgba(255, 255, 255, 0.1);
  --danger: #ef4444;
  --warning: #f59e0b;
  --success: #22c55e;
}

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

body {
  background-color: var(--bg-dark);
  color: var(--text-main);
  min-height: 100vh;
  background-image: 
    radial-gradient(at 0% 0%, hsla(158, 82%, 25%, 0.15) 0px, transparent 50%),
    radial-gradient(at 100% 100%, hsla(210, 100%, 15%, 0.15) 0px, transparent 50%);
  background-attachment: fixed;
  display: flex;
  flex-direction: column;
}

/* Glassmorphism utility */
.glass-panel {
  background: var(--bg-panel);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
}

/* Typography */
h1, h2, h3 {
  font-weight: 600;
  margin-bottom: 1rem;
}
.text-muted { color: var(--text-muted); }
.text-center { text-align: center; }
.text-primary { color: var(--primary-color); }

/* Forms & Inputs */
.form-group {
  margin-bottom: 1.5rem;
  display: flex;
  flex-direction: column;
}
label {
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
  color: var(--text-muted);
}
input, select, textarea {
  width: 100%;
  padding: 12px 16px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-main);
  font-size: 1rem;
  transition: all 0.3s ease;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
}
.btn-primary {
  background: var(--primary-color);
  color: #fff;
}
.btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}
.btn-danger {
  background: transparent;
  border: 1px solid var(--danger);
  color: var(--danger);
}
.btn-danger:hover {
  background: var(--danger);
  color: #fff;
}
.btn-block {
  width: 100%;
}

/* Layouts */
.auth-container {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  padding: 20px;
}
.auth-box {
  width: 100%;
  max-width: 420px;
}
.logo-container {
  text-align: center;
  margin-bottom: 2rem;
}
.logo-container h1 {
  font-size: 2rem;
  background: linear-gradient(135deg, #10b981, #3b82f6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Dashboard Layout */
.dashboard-layout {
  display: flex;
  min-height: 100vh;
  position: relative;
}
.sidebar-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5);
  z-index: 99;
}
.sidebar-overlay.active {
  display: block;
}
.sidebar {
  width: 260px;
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(20px);
  border-right: 1px solid var(--border-color);
  padding: 24px;
  display: flex;
  flex-direction: column;
  z-index: 100;
  transition: transform 0.3s ease;
}
.nav-menu {
  list-style: none;
  margin-top: 2rem;
  flex: 1;
}
.nav-item {
  margin-bottom: 0.5rem;
}
.nav-link {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  color: var(--text-muted);
  text-decoration: none;
  border-radius: 8px;
  transition: all 0.2s ease;
}
.nav-link:hover, .nav-link.active {
  background: rgba(16, 185, 129, 0.1);
  color: var(--primary-color);
}
.nav-link i {
  margin-right: 12px;
  font-size: 1.2rem;
}
.main-content {
  flex: 1;
  padding: 32px;
  overflow-y: auto;
}
.header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-color);
}

/* Cards & Stats */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  margin-bottom: 2rem;
}
.stat-card {
  padding: 20px;
  border-left: 4px solid var(--primary-color);
}
.stat-card h3 {
  font-size: 0.9rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}
.stat-card .value {
  font-size: 2rem;
  font-weight: 700;
  margin-top: 8px;
}

/* Tables */
.table-container {
  overflow-x: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
}
th, td {
  padding: 16px;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}
th {
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.9rem;
}
tbody tr {
  transition: background 0.2s;
}
tbody tr:hover {
  background: rgba(255, 255, 255, 0.02);
}
.status-badge {
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
}
.status-enquiry { background: rgba(59, 130, 246, 0.2); color: #60a5fa; }
.status-hot { background: rgba(245, 158, 11, 0.2); color: #fbbf24; }
.status-closed { background: rgba(34, 197, 94, 0.2); color: #4ade80; }
.status-cancelled { background: rgba(239, 68, 68, 0.2); color: #f87171; }

/* Modals */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.modal-overlay.active {
  opacity: 1;
  pointer-events: all;
}
.modal-content {
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  transform: translateY(20px);
  transition: transform 0.3s ease;
}
.modal-overlay.active .modal-content {
  transform: translateY(0);
}
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}
.close-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
}

/* Utilities */
.hidden { display: none !important; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.d-md-none { display: none; }

/* Responsive */
@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
    transform: translateX(-100%);
  }
  .sidebar.active {
    transform: translateX(0);
  }
  .d-md-none { display: block; }
  .grid-2 { grid-template-columns: 1fr; }
  .main-content { padding: 16px; }
  
  .header-bar { flex-direction: column; align-items: flex-start; gap: 10px; }
  .header-bar > div:last-child { width: 100%; }
  .header-bar .btn { width: 100%; }
  
  .stats-grid { grid-template-columns: 1fr; }
  
  .modal-content { padding: 16px; max-height: 95vh; }
  .modal-header h3 { font-size: 1.2rem; }
}

/* Quotation Print Template */
@media print {
  body * {
    visibility: hidden;
  }
  #quotation-print-area, #quotation-print-area * {
    visibility: visible;
  }
  #quotation-print-area {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    background: white;
    color: black;
    padding: 20px;
  }
  .glass-panel { background: white; border: none; box-shadow: none; color: black; }
  .btn { display: none; }
}
