/* style.css */
:root {
  /* Color Palette - Soft Ocean Theme */
  --pr-blue: #3b82f6; /* Soft Blue */
  --pr-blue-light: #bfdbfe;
  --pr-blue-dark: #1d4ed8;
  --pr-green: #10b981; /* Soft Green */
  --pr-green-light: #a7f3d0;
  
  --bg-color: #f4f7f6;
  --surface-color: #ffffff;
  --surface-hover: #f8fafc;
  
  --text-main: #1e293b;
  --text-muted: #64748b;
  --text-light: #f8fafc;
  
  --border-color: #e2e8f0;
  --error: #ef4444;
  --error-light: #fecaca;
  --warning: #f59e0b;

  --rounded: 12px;
  --rounded-lg: 20px;
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
  --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  --shadow-float: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  
  --sidebar-w: 260px;
  --nav-h: 70px;
}

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

body {
  font-family: 'Inter', sans-serif;
  background-color: var(--bg-color);
  color: var(--text-main);
  line-height: 1.5;
  overflow-x: hidden;
}

.hidden { display: none !important; }
.flex-center { display: flex; align-items: center; justify-content: center; }

/* typography */
h1, h2, h3, h4 { color: var(--text-main); font-weight: 600; margin-bottom: 0.5rem; }
p { color: var(--text-muted); }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: var(--rounded);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease-in-out;
  border: none;
  font-size: 0.95rem;
}
.btn-primary {
  background: linear-gradient(135deg, var(--pr-blue), var(--pr-blue-dark));
  color: white;
  box-shadow: 0 4px 14px 0 rgba(59, 130, 246, 0.39);
}
.btn-primary:hover { box-shadow: 0 6px 20px rgba(59, 130, 246, 0.5); transform: translateY(-1px); }
.btn-success {
  background: linear-gradient(135deg, var(--pr-green), #059669);
  color: white;
}
.btn-danger {
  background: var(--error); color: white;
}
.btn-outline {
  background: transparent; border: 1px solid var(--border-color); color: var(--text-main);
}
.btn-outline:hover { background: var(--surface-hover); }

/* Forms */
.input-group { margin-bottom: 1.25rem; }
.input-group label { display: block; font-size: 0.85rem; font-weight: 500; margin-bottom: 0.4rem; color: var(--text-muted); }
.input-wrapper {
  position: relative;
  display: flex; align-items: center;
}
.input-wrapper i { position: absolute; left: 1rem; color: var(--text-muted); font-size: 1.2rem; }
.input-wrapper input, .input-wrapper select, .input-wrapper textarea {
  width: 100%;
  padding: 0.75rem 1rem 0.75rem 2.8rem;
  border: 1px solid var(--border-color);
  border-radius: var(--rounded);
  background: var(--surface-color);
  font-family: inherit;
  font-size: 0.95rem;
  color: var(--text-main);
  transition: all 0.2s;
}
.input-wrapper input:focus, .input-wrapper select:focus, .input-wrapper textarea:focus {
  outline: none;
  border-color: var(--pr-blue);
  box-shadow: 0 0 0 3px var(--pr-blue-light);
}

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

/* Glassmorphism Panels */
.glass-panel {
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: var(--shadow-lg);
  border-radius: var(--rounded-lg);
}

/* Login Screen */
#login-screen {
  height: 100vh;
  width: 100vw;
  background: radial-gradient(circle at top left, var(--pr-blue-light), transparent 40%),
              radial-gradient(circle at bottom right, var(--pr-green-light), transparent 40%);
  background-color: var(--bg-color);
}
.login-card {
  width: 100%;
  max-width: 400px;
  padding: 2.5rem;
  animation: slideUpFade 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}
.login-header { text-align: center; margin-bottom: 2rem; }
.login-header i { font-size: 3rem; color: var(--pr-blue); margin-bottom: 1rem; }
.btn-block { width: 100%; }

/* Layout Settings */
#app-screen { display: flex; height: 100vh; width: 100vw; overflow: hidden; }

/* Sidebar */
.sidebar {
  width: var(--sidebar-w);
  background: var(--surface-color);
  border-right: 1px solid var(--border-color);
  display: flex; flex-direction: column;
  transition: transform 0.3s ease;
  z-index: 50;
}
.sidebar-header {
  height: var(--nav-h);
  padding: 0 1.5rem;
  display: flex; align-items: center; gap: 0.75rem;
  border-bottom: 1px solid var(--border-color);
}
.logo-box {
  width: 36px; height: 36px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--pr-blue), var(--pr-green));
  color: white; display: flex; align-items: center; justify-content: center; font-size: 1.4rem;
}
.sidebar-nav { flex: 1; padding: 1.5rem 1rem; overflow-y: auto; display: flex; flex-direction: column; gap: 0.5rem; }
.nav-item {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: var(--rounded);
  color: var(--text-muted); text-decoration: none; font-weight: 500;
  transition: all 0.2s;
}
.nav-item i { font-size: 1.25rem; }
.nav-item:hover { background: var(--surface-hover); color: var(--text-main); }
.nav-item.active {
  background: var(--pr-blue-light); color: var(--pr-blue-dark);
}
.nav-item.active i { color: var(--pr-blue-dark); }
.sidebar-footer {
  padding: 1.5rem; border-top: 1px solid var(--border-color);
  display: flex; align-items: center; justify-content: space-between;
}
.user-profile { display: flex; align-items: center; gap: 0.75rem; }
.avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--surface-hover); display: flex; align-items: center; justify-content: center; font-size: 1.2rem; }
.user-info strong { display: block; font-size: 0.9rem; }
.user-info small { color: var(--text-muted); font-size: 0.75rem; }
.btn-logout { background: transparent; border: none; color: var(--text-muted); cursor: pointer; font-size: 1.25rem; transition: color 0.2s; }
.btn-logout:hover { color: var(--error); }

/* Main Content */
.main-content {
  flex: 1; display: flex; flex-direction: column; overflow: hidden;
  position: relative;
}
.top-nav {
  height: var(--nav-h);
  background: var(--surface-color); border-bottom: 1px solid var(--border-color);
  display: flex; align-items: center; justify-content: space-between; padding: 0 2rem;
}
.top-nav-left, .top-nav-right { display: flex; align-items: center; gap: 1rem; }
.menu-toggle { display: none; background: transparent; border: none; font-size: 1.5rem; cursor: pointer; }
#current-date { font-size: 0.85rem; color: var(--text-muted); font-weight: 500; }
.icon-btn { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--border-color); background: white; cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 1.2rem; color: var(--text-muted); transition: 0.2s; }
.icon-btn:hover { background: var(--surface-hover); color: var(--pr-blue); }

.view-container {
  flex: 1; padding: 2rem; overflow-y: auto;
}
.view-section { animation: fadeIn 0.4s ease; }

/* Dashboard Cards */
.dash-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1.5rem; margin-bottom: 2rem;
}
.stat-card {
  background: white; padding: 1.5rem; border-radius: var(--rounded-lg); border: 1px solid var(--border-color);
  box-shadow: var(--shadow); display: flex; align-items: center; gap: 1rem; transition: transform 0.2s;
}
.stat-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); border-color: var(--pr-blue-light); }
.stat-icon { width: 50px; height: 50px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 1.8rem; }
.bg-blue { background: var(--pr-blue-light); color: var(--pr-blue-dark); }
.bg-green { background: var(--pr-green-light); color: #065f46; }
.bg-yellow { background: #fef3c7; color: #92400e; }
.bg-red { background: var(--error-light); color: #991b1b; }
.stat-info h3 { font-size: 0.85rem; color: var(--text-muted); margin: 0; }
.stat-info p { font-size: 1.5rem; font-weight: 700; color: var(--text-main); margin: 0; }

.modules-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1.5rem; margin-top: 2rem;
}
.module-card {
  background: white; border: 1px solid var(--border-color); border-radius: var(--rounded-lg);
  padding: 1.5rem; text-align: center; cursor: pointer; transition: 0.2s; box-shadow: var(--shadow);
  text-decoration: none; display: block;
}
.module-card:hover { border-color: var(--pr-blue); transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.module-card i { font-size: 2.5rem; color: var(--pr-blue); margin-bottom: 1rem; }
.module-card h3 { font-size: 1rem; margin: 0; color: var(--text-main); }

/* Content Cards & Tables */
.card { background: white; border-radius: var(--rounded-lg); border: 1px solid var(--border-color); box-shadow: var(--shadow); padding: 1.5rem; margin-bottom: 1.5rem; }
.card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.5rem; border-bottom: 1px solid var(--border-color); padding-bottom: 1rem; }
.table-responsive { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 1rem; text-align: left; border-bottom: 1px solid var(--border-color); }
th { background: var(--surface-hover); color: var(--text-muted); font-weight: 600; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.05em; }
tbody tr:hover { background: var(--surface-hover); }
.badge { padding: 0.25rem 0.75rem; border-radius: 999px; font-size: 0.75rem; font-weight: 600; }
.badge-success { background: var(--pr-green-light); color: #065f46; }
.badge-danger { background: var(--error-light); color: #991b1b; }

/* Toasts */
#toast-container { position: fixed; bottom: 20px; right: 20px; z-index: 9999; display: flex; flex-direction: column; gap: 10px; }
.toast {
  background: white; border-radius: 8px; box-shadow: var(--shadow-float); padding: 1rem 1.5rem;
  display: flex; align-items: center; gap: 0.75rem;
  animation: slideInRight 0.3s cubic-bezier(0.16, 1, 0.3, 1), fadeOut 0.3s 2.7s forwards;
  border-left: 4px solid var(--pr-blue);
}
.toast.success { border-left-color: var(--pr-green); }
.toast.error { border-left-color: var(--error); }
.toast i { font-size: 1.2rrem; }
.toast.success i { color: var(--pr-green); }
.toast.error i { color: var(--error); }

/* Animations */
@keyframes slideUpFade {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes slideInRight {
  from { opacity: 0; transform: translateX(100%); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes fadeOut {
  to { opacity: 0; transform: translateY(10px); }
}

/* Print Styles */
.print-only { display: none; }
@media print {
  body * { visibility: hidden; }
  #print-area, #print-area * { visibility: visible; }
  #print-area { position: absolute; left: 0; top: 0; width: 100%; display: block !important; }
  .no-print { display: none !important; }
  
  /* Print Templates */
  .tc-print { padding: 40px; font-family: 'Times New Roman', serif; text-align: center; border: 4px double #000; margin: 20px;}
  .tc-print h1 { font-size: 28px; margin-bottom: 5px; text-transform: uppercase; }
  .tc-print h3 { font-size: 20px; text-decoration: underline; margin: 20px 0; }
  .tc-details { text-align: left; margin: 40px 0; font-size: 18px; line-height: 2; }
  .tc-details span { border-bottom: 1px dotted #000; display: inline-block; min-width: 200px; padding: 0 10px; font-weight: bold; }
  .tc-signatures { display: flex; justify-content: space-between; margin-top: 80px; }
  .tc-sig-box { border-top: 1px solid #000; padding-top: 5px; width: 200px; text-align: center; }
  
  .receipt-print { padding: 30px; border: 1px solid #000; font-family: Arial, sans-serif; max-width: 500px; margin: 0 auto; }
  .receipt-header { text-align: center; border-bottom: 2px dashed #000; padding-bottom: 10px; margin-bottom: 20px; }
  .receipt-row { display: flex; justify-content: space-between; margin-bottom: 10px; }
  .receipt-total { border-top: 1px solid #000; margin-top: 10px; padding-top: 10px; font-weight: bold; font-size: 1.2rem; }
}

/* Responsive */
@media (max-width: 768px) {
  .sidebar { position: fixed; top: 0; left: 0; height: 100%; transform: translateX(-100%); width: 280px; box-shadow: var(--shadow-float); }
  .sidebar.open { transform: translateX(0); }
  .menu-toggle { display: block; }
  .mobile-close { display: block; background: transparent; border: none; font-size: 1.5rem; color: var(--text-muted); }
  .sidebar-header { justify-content: space-between; }
  .top-nav { padding: 0 1rem; }
  .view-container { padding: 1rem; }
}
@media (min-width: 769px) {
  .mobile-close { display: none; }
}
