/* ==========================================================
   assets/css/style.css
   ระบบรับเรื่องร้องเรียน มหาวิทยาลัยราชภัฏเลย
   ========================================================== */

/* ---------- Google Font ---------- */
@import url('https://fonts.googleapis.com/css2?family=Sarabun:wght@300;400;500;600;700&display=swap');

/* ---------- CSS Variables ---------- */
:root {
  --lru-navy:     #0f2448;
  --lru-navy2:    #1a3a6b;
  --lru-blue:     #2a5298;
  --lru-gold:     #c8a84b;
  --lru-gold2:    #e8c870;
  --lru-red:      #c0392b;
  --lru-green:    #1a7a4a;
  --lru-gray:     #f4f6f9;
  --lru-border:   #dee2e6;
  --lru-shadow:   0 2px 16px rgba(15,36,72,.10);
  --lru-radius:   .6rem;
  --lru-radius-lg:1rem;
  --transition:   .2s ease;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Sarabun', sans-serif;
  font-size: 15px;
  background: var(--lru-gray);
  color: #222;
  line-height: 1.7;
}

a { color: var(--lru-blue); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--lru-navy); }

h1,h2,h3,h4,h5,h6 { font-weight: 600; }

/* ---------- Navbar ---------- */
.navbar-lru {
  background: linear-gradient(135deg, var(--lru-navy2) 0%, var(--lru-navy) 100%);
  box-shadow: 0 2px 12px rgba(0,0,0,.25);
  padding: .65rem 0;
}

.navbar-lru .navbar-brand {
  font-weight: 700;
  font-size: 1.05rem;
  color: #fff !important;
  display: flex;
  align-items: center;
  gap: .6rem;
}

.navbar-lru .nav-link {
  color: rgba(255,255,255,.80) !important;
  font-weight: 500;
  padding: .4rem .9rem !important;
  border-radius: .4rem;
  transition: all var(--transition);
}

.navbar-lru .nav-link:hover,
.navbar-lru .nav-link.active {
  color: #fff !important;
  background: rgba(255,255,255,.12);
}

.navbar-logo {
  width: 38px; height: 38px;
  background: var(--lru-gold);
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: .95rem;
  color: var(--lru-navy);
  flex-shrink: 0;
}

/* ---------- Hero ---------- */
.hero-section {
  background: linear-gradient(135deg, var(--lru-navy2) 0%, var(--lru-blue) 60%, #3a6cb8 100%);
  padding: 3.5rem 0 3rem;
  position: relative;
  overflow: hidden;
}

.hero-section::before {
  content: '';
  position: absolute;
  top: -60px; right: -60px;
  width: 280px; height: 280px;
  border-radius: 50%;
  background: rgba(200,168,75,.08);
  pointer-events: none;
}

.hero-section::after {
  content: '';
  position: absolute;
  bottom: -80px; left: -30px;
  width: 220px; height: 220px;
  border-radius: 50%;
  background: rgba(255,255,255,.05);
  pointer-events: none;
}

.hero-badge {
  display: inline-block;
  background: rgba(200,168,75,.20);
  border: 1px solid rgba(200,168,75,.45);
  color: var(--lru-gold2);
  font-size: .8rem;
  padding: .3rem .85rem;
  border-radius: 2rem;
  margin-bottom: 1rem;
}

.hero-section h1 {
  color: #fff;
  font-size: 1.7rem;
  line-height: 1.4;
}

.hero-section p {
  color: rgba(255,255,255,.78);
  font-size: .95rem;
  max-width: 580px;
}

/* ---------- Stats Bar ---------- */
.stats-bar {
  background: #fff;
  border-bottom: 1px solid var(--lru-border);
  box-shadow: 0 2px 8px rgba(0,0,0,.06);
}

.stat-item {
  padding: 1.1rem 1.5rem;
  text-align: center;
  border-right: 1px solid var(--lru-border);
}

.stat-item:last-child { border-right: none; }

.stat-num {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--lru-navy);
  line-height: 1.1;
}

.stat-label {
  font-size: .78rem;
  color: #888;
  margin-top: .15rem;
}

/* ---------- Cards ---------- */
.card-lru {
  background: #fff;
  border: 1px solid var(--lru-border);
  border-radius: var(--lru-radius-lg);
  box-shadow: var(--lru-shadow);
}

.card-lru .card-header-lru {
  padding: 1.1rem 1.4rem;
  border-bottom: 1px solid var(--lru-border);
  font-weight: 600;
  font-size: 1rem;
  color: var(--lru-navy);
  display: flex;
  align-items: center;
  gap: .5rem;
}

.card-lru .card-body { padding: 1.4rem; }

/* ---------- Section Title ---------- */
.section-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--lru-navy);
  margin-bottom: 1rem;
  padding-left: .8rem;
  border-left: 4px solid var(--lru-gold);
}

/* ---------- Step Cards ---------- */
.step-card {
  background: #fff;
  border: 1px solid var(--lru-border);
  border-radius: var(--lru-radius);
  padding: 1.1rem;
  text-align: center;
  transition: box-shadow var(--transition), transform var(--transition);
}

.step-card:hover {
  box-shadow: 0 6px 20px rgba(26,58,107,.12);
  transform: translateY(-3px);
}

.step-num {
  width: 36px; height: 36px;
  background: var(--lru-navy);
  color: #fff;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: .85rem;
  font-weight: 700;
  margin-bottom: .65rem;
}

/* ---------- Confidential Box ---------- */
.confidential-box {
  background: #fffbf0;
  border: 1px solid #f0d060;
  border-radius: var(--lru-radius);
  padding: .8rem 1rem;
  font-size: .875rem;
  color: #7a5200;
  display: flex;
  align-items: flex-start;
  gap: .7rem;
}

.confidential-box .conf-icon {
  width: 22px; height: 22px;
  background: #d4690a;
  color: #fff;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: .7rem;
  font-weight: 700;
  flex-shrink: 0;
  margin-top: .1rem;
}

/* ---------- Form Elements ---------- */
.form-label-lru {
  font-size: .85rem;
  font-weight: 600;
  color: #444;
  margin-bottom: .3rem;
}

.form-label-lru .required {
  color: var(--lru-red);
  margin-left: .15rem;
}

.form-control:focus,
.form-select:focus {
  border-color: var(--lru-blue);
  box-shadow: 0 0 0 .2rem rgba(42,82,152,.18);
}

.upload-zone {
  border: 2px dashed var(--lru-border);
  border-radius: var(--lru-radius);
  padding: 1.4rem;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  color: #888;
  font-size: .875rem;
}

.upload-zone:hover {
  border-color: var(--lru-blue);
  background: #f0f4fb;
  color: var(--lru-blue);
}

/* ---------- Buttons ---------- */
.btn-lru-primary {
  background: var(--lru-gold);
  color: var(--lru-navy);
  border: none;
  font-weight: 700;
  transition: all var(--transition);
}

.btn-lru-primary:hover {
  background: var(--lru-gold2);
  color: var(--lru-navy);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(200,168,75,.35);
}

.btn-lru-navy {
  background: var(--lru-navy);
  color: #fff;
  border: none;
  font-weight: 600;
  transition: all var(--transition);
}

.btn-lru-navy:hover {
  background: var(--lru-navy2);
  color: #fff;
}

/* ---------- Admin Sidebar ---------- */
.admin-sidebar {
  min-height: 100vh;
  width: 220px;
  background: linear-gradient(180deg, var(--lru-navy2) 0%, var(--lru-navy) 100%);
  position: fixed;
  top: 0; left: 0;
  z-index: 200;
  display: flex;
  flex-direction: column;
  box-shadow: 2px 0 12px rgba(0,0,0,.18);
}

.admin-sidebar .sidebar-brand {
  padding: 1.2rem 1rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,.10);
  display: flex;
  align-items: center;
  gap: .6rem;
  text-decoration: none;
}

.admin-sidebar .sidebar-brand span {
  color: #fff;
  font-weight: 700;
  font-size: .92rem;
  line-height: 1.3;
}

.admin-sidebar .sidebar-label {
  font-size: .72rem;
  color: rgba(255,255,255,.38);
  text-transform: uppercase;
  letter-spacing: .06em;
  padding: .9rem 1.1rem .25rem;
}

.admin-sidebar .nav-link {
  color: rgba(255,255,255,.72) !important;
  font-size: .88rem;
  font-weight: 500;
  padding: .55rem 1.1rem !important;
  border-radius: 0;
  display: flex;
  align-items: center;
  gap: .55rem;
  transition: all var(--transition);
  border-left: 3px solid transparent;
}

.admin-sidebar .nav-link:hover {
  color: #fff !important;
  background: rgba(255,255,255,.08);
}

.admin-sidebar .nav-link.active {
  color: var(--lru-gold2) !important;
  background: rgba(200,168,75,.14);
  border-left-color: var(--lru-gold);
}

.admin-sidebar .sidebar-divider {
  border-top: 1px solid rgba(255,255,255,.09);
  margin: .5rem 1rem;
}

/* ---------- Admin Main Content ---------- */
.admin-wrapper { 
  margin-left: 230px;
  margin-right: 1px; 

}

.admin-topbar {
  background: #fff;
  border-bottom: 1px solid var(--lru-border);
  padding: .7rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 6px rgba(0,0,0,.06);
}

.admin-content { padding: 1rem; }

/* ---------- Metric Cards ---------- */
.metric-card {
  background: #fff;
  border: 1px solid var(--lru-border);
  border-radius: var(--lru-radius);
  padding: 1.1rem 1.25rem;
  transition: box-shadow var(--transition);
}

.metric-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,.10); }

.metric-card .metric-icon {
  width: 42px; height: 42px;
  border-radius: var(--lru-radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  margin-bottom: .65rem;
}

.metric-card .metric-num {
  font-size: 1.8rem;
  font-weight: 700;
  line-height: 1;
}

.metric-card .metric-label {
  font-size: .78rem;
  color: #888;
  margin-top: .25rem;
}

/* ---------- Data Table ---------- */
.table-lru th {
  background: var(--lru-gray);
  font-size: .78rem;
  font-weight: 700;
  color: #666;
  text-transform: uppercase;
  letter-spacing: .04em;
  border-bottom: 2px solid var(--lru-border) !important;
  padding: .65rem .9rem;
  white-space: nowrap;
}

.table-lru td {
  padding: .7rem .9rem;
  vertical-align: middle;
  font-size: .875rem;
  border-color: var(--lru-border);
}

.table-lru tbody tr:hover { background: #f5f7fb; }

.ref-code-link {
  font-weight: 700;
  color: var(--lru-navy) !important;
  font-size: .85rem;
}

/* ---------- Timeline ---------- */
.timeline { position: relative; padding-left: 1.6rem; }

.timeline::before {
  content: '';
  position: absolute;
  left: .55rem; top: 0; bottom: 0;
  width: 2px;
  background: var(--lru-border);
}

.timeline-item {
  position: relative;
  padding-bottom: 1.2rem;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -1.07rem;
  top: .3rem;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--lru-navy);
  border: 2px solid #fff;
  box-shadow: 0 0 0 2px var(--lru-navy);
}

.timeline-item.done::before { background: var(--lru-green); box-shadow: 0 0 0 2px var(--lru-green); }

.timeline-item .tl-title {
  font-size: .875rem;
  font-weight: 600;
  color: #333;
}

.timeline-item .tl-meta {
  font-size: .78rem;
  color: #999;
  margin-top: .1rem;
}

/* ---------- Login Page ---------- */
.login-wrapper {
  min-height: 100vh;
  background: linear-gradient(135deg, var(--lru-navy2), var(--lru-blue));
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.login-card {
  background: #fff;
  border-radius: var(--lru-radius-lg);
  padding: 2.4rem 2rem;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 8px 40px rgba(0,0,0,.25);
}

/* ---------- Track Section ---------- */
.track-result {
  background: var(--lru-gray);
  border: 1px solid var(--lru-border);
  border-radius: var(--lru-radius);
  padding: 1.1rem 1.2rem;
}

/* ---------- Alert ---------- */
.alert-lru-success {
  background: #e8f7ee;
  border: 1px solid #a8ddc0;
  color: #1a5c36;
  border-radius: var(--lru-radius);
  padding: 1rem 1.2rem;
}

/* ---------- Footer ---------- */
.footer-lru {
  background: var(--lru-navy);
  color: rgba(255,255,255,.65);
  font-size: .82rem;
  padding: 1.2rem 0;
  text-align: center;
}

/* ---------- Responsive ---------- */
@media (max-width: 992px) {
  .admin-sidebar { width: 200px; }
  .admin-wrapper { margin-left: 200px; }
}

@media (max-width: 768px) {
  .admin-sidebar { transform: translateX(-100%); transition: transform .3s; }
  .admin-sidebar.open { transform: translateX(0); }
  .admin-wrapper { margin-left: 0; }
  .hero-section { padding: 2rem 0; }
  .hero-section h1 { font-size: 1.3rem; }
  .stat-item { padding: .8rem; }
  .stat-num { font-size: 1.4rem; }
}

@media (max-width: 576px) {
  .stats-bar .row { flex-wrap: nowrap; overflow-x: auto; }
}