/* 
 * PCBS Inventory System v3.0 
 * Unified Design System
 */

:root {
  --primary: #0B5120;
  --primary-light: #167a32;
  --primary-dark: #063113;
  --secondary: #FF6F61;
  --secondary-hover: #ff5442;
  --background: #f8fafc;
  --surface: #ffffff;
  --text: #334155;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --danger: #ef4444;
  --success: #10b981;
  --warning: #f59e0b;
  --radius: 8px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.1);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1);
}

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

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background-color: var(--background);
  color: var(--text);
  line-height: 1.4;
  font-size: 13.5px;
}

/* Typography */
h1, h2, h3, h4 {
  color: #0f172a;
  font-weight: 600;
  margin-bottom: 1rem;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  color: var(--primary-dark);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius);
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
  text-decoration: none;
  font-size: 0.85rem;
}

.btn-primary {
  background-color: var(--primary);
  color: white;
}
.btn-primary:hover {
  background-color: var(--primary-light);
  transform: translateY(-1px);
}

.btn-secondary {
  background-color: var(--secondary);
  color: white;
}
.btn-secondary:hover {
  background-color: var(--secondary-hover);
}

.btn-outline {
  background-color: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}
.btn-outline:hover {
  background-color: #f1f5f9;
  border-color: #cbd5e1;
}

.btn-danger {
  background-color: var(--danger);
  color: white;
}
.btn-danger:hover {
  background-color: #dc2626;
}

/* Forms */
.form-group {
  margin-bottom: 0.75rem;
}

.form-label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: #475569;
}

.form-control {
  width: 100%;
  padding: 0.45rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background-color: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: 0.88rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(11, 81, 32, 0.15);
}

/* Cards */
.card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  overflow: hidden;
}

.card-header {
  padding: 0.75rem 1.25rem;
  border-bottom: 1px solid var(--border);
  background-color: #f8fafc;
}

.card-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
}

.card-body {
  padding: 1rem 1.25rem;
}

.card-footer {
  padding: 0.75rem 1.25rem;
  border-top: 1px solid var(--border);
  background-color: #f8fafc;
}

/* Tables */
.table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.table th, .table td {
  padding: 0.25rem 0.5rem;
  border-bottom: 1px solid var(--border);
  font-size: 12.5px;
}

.table th {
  background-color: #f1f5f9;
  font-weight: 600;
  color: #475569;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.table tbody tr:hover {
  background-color: #f8fafc;
}

/* Alerts */
.alert {
  padding: 1rem;
  border-radius: var(--radius);
  margin-bottom: 1.5rem;
  border: 1px solid transparent;
}

.alert-danger {
  background-color: #fef2f2;
  color: #991b1b;
  border-color: #fecaca;
}

.alert-success {
  background-color: #ecfdf5;
  color: #065f46;
  border-color: #a7f3d0;
}

.alert-info {
  background-color: #eff6ff;
  color: #1e40af;
  border-color: #bfdbfe;
}

/* Layout */
.app-container {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 240px;
  background-color: #051c0c;
  color: #cbd5e1;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  border-right: 1px solid #063113;
}

.sidebar-brand {
  padding: 1.25rem;
  font-size: 1.15rem;
  font-weight: 700;
  color: white;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  border-bottom: 1px solid #063113;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  box-shadow: inset 0 -2px 5px rgba(0, 0, 0, 0.15);
}

.sidebar-nav {
  padding: 0.75rem 0;
  flex: 1;
  overflow-y: auto;
}

.nav-item {
  display: flex;
  align-items: center;
  padding: 0.45rem 1.25rem;
  color: #cbd5e1;
  font-weight: 500;
  font-size: 0.88rem;
  border-left: 3px solid transparent;
  transition: all 0.2s ease;
}

.nav-item:hover {
  background-color: #093318;
  color: white;
  border-left-color: #ff8a7a;
  padding-left: 1.4rem;
}

.nav-item.active {
  background-color: #083a1a;
  color: white;
  border-left-color: var(--secondary);
  font-weight: 600;
}

.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.topbar {
  height: 50px;
  background-color: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.25rem;
  box-shadow: var(--shadow-sm);
}

.content-area {
  padding: 1rem;
  flex: 1;
  overflow-y: auto;
}

/* Login Page Specific */
.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background-color: #051c0c;
  padding: 1rem;
  overflow: hidden;
  position: relative;
}

/* Subtle background glowing mesh circles using green-themed colors */
.login-page::before, .login-page::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  z-index: 0;
  pointer-events: none;
}
.login-page::before {
  width: 400px;
  height: 400px;
  background: rgba(11, 81, 32, 0.25);
  top: 15%;
  left: 20%;
  transform: translate(-50%, -50%);
}
.login-page::after {
  width: 500px;
  height: 500px;
  background: rgba(22, 122, 50, 0.15);
  bottom: 10%;
  right: 15%;
  transform: translate(50%, 50%);
}

.login-container {
  width: 100%;
  max-width: 460px;
  z-index: 1;
  animation: fadeIn 0.8s ease-out;
}

.login-page .login-card {
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 1.5rem;
  box-shadow: 
    0 20px 50px rgba(0, 0, 0, 0.3),
    0 0 40px rgba(11, 81, 32, 0.05),
    inset 0 0 0 1px rgba(255, 255, 255, 0.05);
  padding: 3rem 2.5rem;
  position: relative;
  overflow: hidden;
}

.login-page .branding {
  text-align: center;
  margin-bottom: 2.5rem;
}

.login-page .logo {
  width: 180px;
  height: auto;
  margin-bottom: 1.25rem;
  filter: drop-shadow(0 4px 12px rgba(11, 81, 32, 0.2));
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.login-page .logo:hover {
  transform: scale(1.05);
}

.login-page .brand-text h1 {
  color: #f8fafc;
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  margin-bottom: 0.35rem;
}

.login-page .brand-text p {
  color: #94a3b8;
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 0;
}

/* Form Styles */
.login-page .input-field {
  position: relative;
  margin-bottom: 1.75rem;
}

.login-page .input-icon {
  position: absolute;
  left: 1.25rem;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  fill: #94a3b8;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
  z-index: 2;
}

.login-page .input-field input {
  width: 100%;
  padding: 1.1rem 1rem 1.1rem 3.25rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0.85rem;
  font-size: 0.95rem;
  background: rgba(15, 23, 42, 0.6);
  color: #f8fafc;
  outline: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.login-page .input-field input::placeholder {
  color: transparent;
}

.login-page .input-field label {
  position: absolute;
  left: 3.25rem;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  pointer-events: none;
  font-size: 0.95rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Focus and input states */
.login-page .input-field input:focus {
  border-color: var(--primary);
  background: rgba(15, 23, 42, 0.8);
  box-shadow: 0 0 0 4px rgba(11, 81, 32, 0.15);
}

.login-page .input-field input:focus ~ .input-icon {
  fill: var(--primary);
}

.login-page .input-field input:focus ~ label,
.login-page .input-field input:not(:placeholder-shown) ~ label,
.login-page .input-field input:-webkit-autofill ~ label {
  transform: translateY(-230%) scale(0.85);
  transform-origin: left top;
  color: var(--primary);
  font-weight: 600;
}

/* Webkit Autofill Overrides */
.login-page input:-webkit-autofill,
.login-page input:-webkit-autofill:hover,
.login-page input:-webkit-autofill:focus,
.login-page input:-webkit-autofill:active {
  -webkit-box-shadow: 0 0 0 100px #0f172a inset !important;
  -webkit-text-fill-color: #f8fafc !important;
  border-color: rgba(255, 255, 255, 0.1);
  transition: background-color 5000s ease-in-out 0s;
}

.login-page .primary-button {
  width: 100%;
  padding: 1.1rem;
  background: var(--primary);
  color: #ffffff;
  border: none;
  border-radius: 0.85rem;
  font-weight: 600;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(11, 81, 32, 0.35);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.login-page .primary-button:hover {
  background: var(--primary-light);
  box-shadow: 0 6px 20px rgba(11, 81, 32, 0.45);
  transform: translateY(-2px);
}
.login-page .primary-button:active {
  transform: translateY(0);
}

.login-page .button-icon {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.login-page .alert {
  padding: 1rem 1.25rem;
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #fecaca;
  border-radius: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.75rem;
  font-size: 0.875rem;
}

.login-page .footer {
  text-align: center;
  margin-top: 2.25rem;
  color: #94a3b8;
  font-size: 0.8rem;
  font-weight: 500;
  line-height: 1.5;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}


/* Badges */
.badge {
  display: inline-block;
  padding: 0.25em 0.6em;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 9999px;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
}

.badge-success { background: #dcfce7; color: #166534; }
.badge-warning { background: #fef9c3; color: #854d0e; }
.badge-danger { background: #fee2e2; color: #991b1b; }
.badge-info { background: #dbeafe; color: #1e40af; }

/* Responsive adjustments for POS screens (1366x768 and 1368x768) */
@media (max-width: 1368px) {
  body {
    font-size: 12.5px;
  }
  
  .sidebar {
    width: 200px;
  }
  
  .sidebar-brand {
    padding: 1rem 0.75rem;
    font-size: 1rem;
    gap: 0.5rem;
  }
  
  .nav-item {
    padding: 0.4rem 0.8rem;
    font-size: 0.82rem;
  }
  
  .nav-item:hover {
    padding-left: 0.95rem;
  }
  
  .topbar {
    height: 44px;
    padding: 0 0.8rem;
  }
  
  .content-area {
    padding: 0.75rem;
  }
  
  .card-header {
    padding: 0.5rem 0.75rem;
  }
  
  .card-body {
    padding: 0.75rem;
  }
  
  .card-footer {
    padding: 0.5rem 0.75rem;
  }
  
  .card-title {
    font-size: 0.92rem;
  }
  
  .btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
    border-radius: 6px;
  }
  
  .form-control {
    padding: 0.35rem 0.6rem;
    font-size: 0.82rem;
  }
  
  .form-group {
    margin-bottom: 0.5rem;
  }
  
  .table th, .table td {
    padding: 0.2rem 0.4rem;
    font-size: 11.5px;
  }
  
  .table th {
    font-size: 10px;
  }
}

