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

body {
  font-family: system-ui, -apple-system, sans-serif;
  background: #F5F7FA;
  color: #222;
  min-height: 100vh;
}

/* ---- LOGIN PAGE ---- */
.login-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
}

.login-card {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.1);
  padding: 40px;
  width: 100%;
  max-width: 400px;
  text-align: center;
}

.login-logo {
  height: 60px;
  margin-bottom: 8px;
}

.login-title {
  font-size: 24px;
  font-weight: 700;
  color: #0055A5;
  margin-bottom: 4px;
}

.login-subtitle {
  color: #666;
  font-size: 14px;
  margin-bottom: 28px;
}

.form-group {
  margin-bottom: 16px;
  text-align: left;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #444;
  margin-bottom: 6px;
}

.form-group input, .form-group select {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid #D0D5DD;
  border-radius: 8px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}

.form-group input:focus, .form-group select:focus {
  border-color: #0055A5;
}

.btn {
  display: inline-block;
  padding: 10px 20px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s;
  text-decoration: none;
}

.btn:hover { opacity: 0.85; }

.btn-primary {
  background: #0055A5;
  color: #fff;
  width: 100%;
  padding: 12px;
}

.btn-danger {
  background: #DC3545;
  color: #fff;
}

.btn-outline {
  background: transparent;
  color: #0055A5;
  border: 1px solid #0055A5;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
}

.error-msg {
  color: #DC3545;
  font-size: 13px;
  margin-top: 12px;
  display: none;
}

.success-msg {
  color: #28A745;
  font-size: 13px;
  margin-top: 12px;
  display: none;
}

/* ---- HEADER / NAV ---- */
.header {
  background: #0055A5;
  color: #fff;
  padding: 0 24px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
}

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

.header-logo {
  height: 32px;
}

.header-brand {
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  text-decoration: none;
}

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

.search-bar {
  padding: 8px 14px;
  border: none;
  border-radius: 20px;
  font-size: 13px;
  width: 240px;
  background: rgba(255,255,255,0.15);
  color: #fff;
  outline: none;
}

.search-bar::placeholder { color: rgba(255,255,255,0.6); }
.search-bar:focus { background: rgba(255,255,255,0.25); }

.header-btn {
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  color: #fff;
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.3);
  cursor: pointer;
  transition: background 0.2s;
}

.header-btn:hover { background: rgba(255,255,255,0.25); }

.user-menu {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

.user-menu a {
  color: rgba(255,255,255,0.8);
  text-decoration: none;
  font-size: 12px;
}

.user-menu a:hover { color: #fff; }

/* ---- TABS ---- */
.tabs {
  display: flex;
  gap: 0;
  background: #fff;
  border-bottom: 1px solid #E5E7EB;
  padding: 0 24px;
}

.tab-btn {
  padding: 14px 24px;
  border: none;
  background: none;
  font-size: 14px;
  font-weight: 600;
  color: #666;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  transition: all 0.2s;
}

.tab-btn:hover { color: #0055A5; }

.tab-btn.active {
  color: #0055A5;
  border-bottom-color: #0055A5;
}

.tab-content {
  display: none;
  padding: 24px;
}

.tab-content.active { display: block; }

/* ---- PRODUCT GRID ---- */
.product-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.product-card {
  background: #fff;
  border: 1px solid #E5E7EB;
  border-radius: 10px;
  padding: 20px;
  transition: box-shadow 0.2s;
}

.product-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.08); }

.product-card h3 {
  font-size: 16px;
  font-weight: 700;
  color: #222;
  margin-bottom: 4px;
}

.product-category {
  font-size: 11px;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 14px;
}

.doc-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.doc-link {
  display: inline-block;
  padding: 5px 12px;
  border-radius: 16px;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  transition: opacity 0.2s;
}

.doc-link:hover { opacity: 0.8; }

.doc-link.intro { background: #E8F0FE; color: #0055A5; }
.doc-link.quick-start { background: #E6F4EA; color: #137333; }
.doc-link.operation { background: #FEF3E2; color: #B45309; }
.doc-link.maintenance { background: #F3E8FF; color: #7C3AED; }
.doc-link.faq { background: #F1F3F5; color: #555; }
.doc-link.extra { background: #FFF7ED; color: #C2410C; }
.doc-link.pdf { background: #FEE2E2; color: #DC2626; }

/* ---- ROLE SECTIONS ---- */
.role-section {
  background: #fff;
  border: 1px solid #E5E7EB;
  border-radius: 10px;
  padding: 24px;
  margin-bottom: 20px;
}

.role-section h2 {
  font-size: 20px;
  font-weight: 700;
  color: #0055A5;
  margin-bottom: 4px;
}

.role-section .subtitle {
  font-size: 13px;
  color: #888;
  margin-bottom: 20px;
}

.role-subsection {
  margin-bottom: 16px;
}

.role-subsection h3 {
  font-size: 14px;
  font-weight: 700;
  color: #444;
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid #F1F3F5;
}

.role-links {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.role-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  font-size: 13px;
}

.role-link a {
  color: #0055A5;
  text-decoration: none;
  font-weight: 500;
}

.role-link a:hover { text-decoration: underline; }

.role-link .product-name {
  color: #222;
  font-weight: 600;
  min-width: 120px;
}

/* ---- PDF TABLE ---- */
.pdf-section {
  background: #fff;
  border: 1px solid #E5E7EB;
  border-radius: 10px;
  padding: 24px;
  margin-bottom: 20px;
}

.pdf-section h2 {
  font-size: 18px;
  font-weight: 700;
  color: #222;
  margin-bottom: 16px;
}

.pdf-table {
  width: 100%;
  border-collapse: collapse;
}

.pdf-table th {
  text-align: left;
  padding: 10px 14px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  color: #888;
  border-bottom: 2px solid #E5E7EB;
}

.pdf-table td {
  padding: 10px 14px;
  font-size: 14px;
  border-bottom: 1px solid #F1F3F5;
}

.pdf-table tr:nth-child(even) { background: #FAFBFC; }

.pdf-table a {
  color: #DC2626;
  text-decoration: none;
  font-weight: 500;
}

.pdf-table a:hover { text-decoration: underline; }

/* ---- ADMIN PAGE ---- */
.admin-container {
  max-width: 900px;
  margin: 24px auto;
  padding: 0 24px;
}

.admin-section {
  background: #fff;
  border: 1px solid #E5E7EB;
  border-radius: 10px;
  padding: 24px;
  margin-bottom: 20px;
}

.admin-section h2 {
  font-size: 18px;
  font-weight: 700;
  color: #222;
  margin-bottom: 16px;
}

.user-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 16px;
}

.user-table th {
  text-align: left;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  color: #888;
  border-bottom: 2px solid #E5E7EB;
}

.user-table td {
  padding: 8px 12px;
  font-size: 14px;
  border-bottom: 1px solid #F1F3F5;
}

.add-user-form {
  display: flex;
  gap: 10px;
  align-items: flex-end;
  flex-wrap: wrap;
  margin-top: 12px;
}

.add-user-form .form-group {
  margin-bottom: 0;
}

.activity-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.activity-table th {
  text-align: left;
  padding: 6px 10px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: #888;
  border-bottom: 2px solid #E5E7EB;
}

.activity-table td {
  padding: 6px 10px;
  border-bottom: 1px solid #F1F3F5;
}

/* ---- UPLOAD SECTION ---- */
.upload-section {
  background: #fff;
  border: 1px solid #E5E7EB;
  border-radius: 10px;
  padding: 24px;
  margin-bottom: 20px;
}

.upload-section h2 {
  font-size: 18px;
  font-weight: 700;
  color: #0055A5;
  margin-bottom: 16px;
}

.upload-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.upload-row {
  display: flex;
  gap: 12px;
  align-items: flex-end;
}

.upload-row .form-group {
  margin-bottom: 0;
}

/* ---- RESPONSIVE ---- */
@media (max-width: 768px) {
  .product-grid { grid-template-columns: repeat(2, 1fr); }
  .search-bar { width: 160px; }
  .header { padding: 0 16px; }
  .tabs { padding: 0 16px; }
  .tab-content { padding: 16px; }
  .add-user-form { flex-direction: column; }
}

@media (max-width: 480px) {
  .product-grid { grid-template-columns: 1fr; }
  .search-bar { display: none; }
  .header-btn { display: none; }
  .tab-btn { padding: 12px 14px; font-size: 13px; }
}
