:root { --primary: #2563eb; --bg: #f3f4f6; --card: #ffffff; }
body { font-family: -apple-system, sans-serif; background: var(--bg); display: flex; justify-content: center; align-items: center; min-height: 100vh; margin: 0; }
.container { width: 100%; max-width: 400px; padding: 20px; padding-top: 50px; }
.card { background: var(--card); padding: 2rem; border-radius: 8px; box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1); }
.hidden { display: none; }
input { width: 100%; padding: 10px; margin: 10px 0; border: 1px solid #ddd; border-radius: 4px; box-sizing: border-box;}
button { width: 100%; padding: 10px; background: var(--primary); color: white; border: none; border-radius: 4px; cursor: pointer; font-weight: bold; }
button:hover { opacity: 0.9; }
button.logout { background: #dc2626; margin-top: 10px; }

#realtime-clock {
  position: fixed;
  top: 15px;
  right: 20px;
  background: rgba(255, 255, 255, 0.9);
  padding: 8px 15px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  color: #333;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  z-index: 1000;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  border: 1px solid #e2e8f0;
}

.app-item { padding: 15px; border: 1px solid #eee; margin-bottom: 10px; border-radius: 4px; cursor: pointer; transition: all 0.2s; background: #fff; }
.app-item:hover { background: #f8fafc; border-color: var(--primary); transform: translateY(-1px); box-shadow: 0 2px 4px rgba(0,0,0,0.05); }
.app-title { font-weight: 700; display: block; text-align: center; font-size: 1.1em; }
.app-desc {
  display: none;
  font-size: 0.9em;
  color: #475569;
  text-align: justify;
  margin-top: 12px;
  line-height: 1.5;
  border-top: 1px dashed #cbd5e1;
  padding-top: 10px;
  animation: fadeIn 0.3s ease;
}
.app-item.expanded .app-desc { display: block; }

.app-actions { display: none; margin-top: 10px; gap: 8px; border-top: 1px solid #eee; padding-top: 10px; }
.app-item.expanded .app-actions { display: flex; }

.btn-action { flex: 1; padding: 10px; font-size: 12px; border-radius: 6px; border: none; cursor: pointer; font-weight: 600; display: flex; align-items: center; justify-content: center; gap: 5px; }
.btn-launch { background: var(--primary); color: white; }
.btn-docs { background: #ef4444; color: white; }

.app-docs-list { display: none; margin-top: 10px; background: #f1f5f9; border: 1px solid #e2e8f0; border-radius: 6px; overflow: hidden; }
.app-docs-list.show { display: block; }

.app-doc-link { display: block; padding: 10px 15px; font-size: 12px; color: #334155; border-bottom: 1px solid #e2e8f0; cursor: pointer; border-left: 4px solid transparent; transition: 0.2s; background: #fff; }
.app-doc-link:last-child { border-bottom: none; }
.app-doc-link:hover { background: #e2e8f0; font-weight: bold; padding-left: 20px; }

#msg { color: #dc2626; text-align: center; margin-bottom: 10px; font-size: 0.9em; }
h2 { text-align: center; margin-top: 0; }

.doc-section { margin-top: 20px; border-top: 1px solid #eee; padding-top: 15px; }
.doc-accordion-header { cursor: pointer; text-align: center; color: #64748b; font-size: 0.85em; font-weight: 600; padding: 10px; background: #f8fafc; border-radius: 6px; border: 1px solid #e2e8f0; transition: 0.2s; }
.doc-accordion-header:hover { background: #e2e8f0; color: #333; }
.doc-list { overflow: hidden; max-height: 0; transition: max-height 0.4s ease-out; }
.doc-list.open { max-height: 500px; overflow-y: auto; margin-top: 10px; }
.doc-item { padding: 12px; border-radius: 6px; margin-bottom: 8px; cursor: pointer; background: #fff; border: 1px solid #eee; border-left: 4px solid #ddd; transition: transform 0.1s; box-shadow: 0 1px 2px rgba(0,0,0,0.03); }
.doc-item:hover { transform: translateX(3px); background: #f8fafc; }

#docViewer { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: white; z-index: 9999; display: none; flex-direction: column; }
#docViewer iframe { flex-grow: 1; border: none; width: 100%; height: 100%; }
.close-doc { position: absolute; top: 15px; right: 25px; font-size: 35px; font-weight: bold; cursor: pointer; color: #1e293b; z-index: 10000; background: rgba(255,255,255,0.9); width: 45px; height: 45px; display: flex; align-items: center; justify-content: center; border-radius: 50%; box-shadow: 0 2px 10px rgba(0,0,0,0.1); }

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

:root {
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --secondary: #64748b;
  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
  --bg-panel: #f8fafc;
  --border: #e2e8f0;
  --text-main: #1e293b;
  --text-muted: #64748b;
}

.sso-admin-container {
  background: #f1f5f9; position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: 1000; display: none;
  font-family: "Inter", sans-serif; color: var(--text-main);
}
.admin-header { background: #fff; padding: 15px 25px; display: flex; justify-content: space-between; align-items: center; box-shadow: 0 1px 3px rgba(0,0,0,0.1); }
.admin-body { padding: 20px; height: calc(100% - 70px); overflow-y: auto; box-sizing: border-box; }

.tab-nav { display: flex; gap: 10px; margin-bottom: 20px; border-bottom: 1px solid var(--border); }
.tab-btn { padding: 10px 20px; border: none; background: transparent; color: var(--text-muted); cursor: pointer; font-weight: 600; border-bottom: 3px solid transparent; width: auto; }
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); background: #fff; }
.admin-content { display: none; animation: fadeIn 0.3s; }
.admin-content.active { display: block; }

.accordion-card { background: #fff; border-radius: 8px; box-shadow: 0 1px 2px rgba(0,0,0,0.05); margin-bottom: 20px; border: 1px solid var(--border); overflow: hidden; }
.accordion-header { background: #f8fafc; padding: 12px 20px; cursor: pointer; font-weight: bold; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--border); }
.accordion-header:hover { background: #f1f5f9; }
.accordion-body { padding: 20px; display: none; }
.accordion-card.open .accordion-body { display: block; }

.grid-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 15px; margin-bottom: 15px; }
.form-group label { display: block; font-size: 11px; margin-bottom: 5px; font-weight: 700; color: var(--secondary); text-transform: uppercase; }
.form-group input, .form-group select { width: 100%; padding: 10px; border: 1px solid var(--border); border-radius: 6px; font-size: 13px; box-sizing: border-box; }
.form-group input:focus, .form-group select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,0.1); }

.checkbox-group {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  background: #f8fafc;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
}

.cb-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  cursor: pointer;
  background: #fff;
  padding: 4px 8px;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
}
.cb-item:hover { background: #f1f5f9; }

.audit-filter-box { background: #fff; border: 1px solid var(--primary); padding: 15px; border-radius: 8px; margin-bottom: 20px; background-color: #eff6ff; }

.btn-save { background: var(--success); color: white; width: 100%; padding: 12px; border: none; border-radius: 6px; font-weight: bold; cursor: pointer; font-size: 14px; transition: 0.2s; }
.btn-save:hover { filter: brightness(90%); }
.btn-save:disabled { background: #cbd5e1; cursor: not-allowed; }

.btn-sm { padding: 6px 12px; border-radius: 4px; border:none; cursor:pointer; font-size:12px; font-weight: 600; }
.btn-edit { background: var(--primary); color: white; margin-right: 5px; }
.btn-del { background: #fee2e2; color: var(--danger); }
.btn-back { background: var(--secondary); color: white; padding:8px 16px; border-radius:6px; cursor:pointer; font-weight:600; }

.btn-new { background: var(--warning); color: #fff; margin-left: auto; margin-right: 10px; padding: 5px 15px; border-radius: 20px; font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; border: none; cursor: pointer; box-shadow: 0 2px 4px rgba(0,0,0,0.1); }
.btn-new:hover { background: #d97706; }

.table-wrapper { max-height: 500px; overflow: auto; border: 1px solid var(--border); border-radius: 8px; background: white; }
table { width: 100%; border-collapse: collapse; font-size: 13px; white-space: nowrap; }
th { background: #f1f5f9; color: var(--secondary); font-weight: 600; text-transform: uppercase; font-size: 11px; padding: 12px 15px; text-align: left; position: sticky; top: 0; z-index: 5; border-bottom: 2px solid var(--border); }
td { padding: 10px 15px; border-bottom: 1px solid var(--border); color: var(--text-main); }
tbody tr:nth-child(even) { background-color: #f8fafc; }
tbody tr:hover { background-color: #e2e8f0; }
.tbl-link { color: var(--primary); text-decoration: none; font-weight: 500; }
.tbl-link:hover { text-decoration: underline; }
