﻿:root {
  --primary: #952323;
  --secondary: #066a82;
  --bg-white: #ffffff;
  --light-bg: #f4f7f6;
  --text-dark: #2d3748;
  --text-muted: #718096;
  --success: #48bb78;
  --danger: #e53e3e;
  --border-color: #e2e8f0;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: "Inter", sans-serif;
}

body {
  background-color: var(--light-bg);
  color: var(--text-dark);
  height: 100vh;
  overflow: hidden;
}

/* --- LOGIN PANEL --- */
#login-container {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
  background: linear-gradient(135deg, var(--secondary) 0%, var(--primary) 100%);
}

.login-card {
  background: var(--bg-white);
  border-radius: 12px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
  width: 100%;
  max-width: 420px;
  padding: 40px;
  text-align: center;
}

.login-header img {
  max-width: 100%;
  height: auto;
  margin-bottom: 20px;
}

.login-header h2 {
  color: var(--primary);
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 5px;
}

.login-header p {
  color: var(--text-muted);
  font-size: 14px;
  margin-bottom: 25px;
}

.form-group {
  margin-bottom: 20px;
  text-align: left;
  position: relative;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 6px;
}

.form-control {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-size: 14px;
  outline: none;
  transition: all 0.3s;
}

.form-control:focus {
  border-color: var(--secondary);
  box-shadow: 0 0 0 3px rgba(6, 106, 130, 0.15);
}

.btn-submit {
  width: 100%;
  padding: 12px;
  background-color: var(--primary);
  color: var(--bg-white);
  border: none;
  border-radius: 6px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.3s;
}

.btn-submit:hover {
  background-color: #7a1d1d;
}

.error-msg {
  color: var(--danger);
  font-size: 13px;
  margin-top: 10px;
  display: none;
}

/* --- DASHBOARD STRUCTURE --- */
#dashboard-container {
  display: none; /* Hidden until login */
  grid-template-columns: 260px 1fr;
  height: 100vh;
}

/* Sidebar */
aside {
  background-color: var(--secondary);
  color: var(--bg-white);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 25px 20px;
}

.sidebar-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 20px;
  margin-bottom: 25px;
}

.sidebar-brand h3 {
  font-size: 15px;
  text-align: center;
  font-weight: 600;
  margin-top: 10px;
  line-height: 1.4;
}

.sidebar-menu {
  list-style: none;
  flex-grow: 1;
}

.sidebar-menu li a {
  display: flex;
  align-items: center;
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  padding: 12px 15px;
  border-radius: 6px;
  margin-bottom: 10px;
  font-weight: 500;
  transition: all 0.2s;
}

.sidebar-menu li a:hover,
.sidebar-menu li.active a {
  background-color: rgba(255, 255, 255, 0.15);
  color: var(--bg-white);
}

.sidebar-menu li a i {
  margin-right: 12px;
  font-size: 18px;
  width: 20px;
}

.sidebar-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 15px;
}

.btn-logout {
  display: flex;
  align-items: center;
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  font-weight: 500;
  padding: 10px;
  border-radius: 6px;
  transition: 0.2s;
}

.btn-logout:hover {
  background: rgba(229, 62, 62, 0.2);
  color: #ff9999;
}

/* Main Workspace */
main {
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

header {
  background-color: var(--bg-white);
  border-bottom: 1px solid var(--border-color);
  padding: 15px 30px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
}

.user-profile i {
  font-size: 24px;
  color: var(--primary);
}

.content-area {
  padding: 30px;
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
}

/* --- DASHBOARD CARDS & FORMS --- */
.page-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 25px;
  border-left: 5px solid var(--primary);
  padding-left: 10px;
}

.grid-layout {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 15px;
}

@media (max-width: 1024px) {
  .grid-layout {
    grid-template-columns: 1fr;
  }
}

.card {
  background: var(--bg-white);
  border-radius: 8px;
  box-shadow:
    0 4px 6px -1px rgba(0, 0, 0, 0.05),
    0 2px 4px -1px rgba(0, 0, 0, 0.03);
  border: 1px solid var(--border-color);
  padding: 25px;
  margin-bottom: 25px;
}

.card-title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 20px;
  color: var(--secondary);
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* CLC Custom Form Styling */
.clc-form {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.btn-action {
  padding: 10px 15px;
  border-radius: 6px;
  font-weight: 600;
  font-size:12px;
  cursor: pointer;
  border: none;
  transition: 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration:none;
}

.btn-primary-clc {
  background-color: var(--primary);
  color: var(--bg-white);
}

.btn-primary-clc:hover {
  background-color: #7c1a1a;
}

.btn-cancel {
  background-color: #cbd5e0;
  color: var(--text-dark);
}

.btn-cancel:hover {
  background-color: #a0aec0;
}

/* --- DATA GRID VIEW --- */
.table-responsive {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 14px;
}

th {
  background-color: #f7fafc;
  color: var(--text-muted);
  font-weight: 600;
  padding: 12px 16px;
  border-bottom: 2px solid var(--border-color);
}

td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-color);
  vertical-align: middle;
}

tr:hover {
  background-color: #fafdff;
}

/* Status Badges */
.badge {
  padding: 4px 8px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.badge-active {
  background-color: #def7ec;
  color: #03543f;
}

.badge-deactive {
  background-color: #fde8e8;
  color: #9b1c1c;
}

/* Grid Actions buttons */
.btn-group {
  display: flex;
  gap: 5px;
}

.btn-icon {
  border: none;
  background: none;
  padding: 6px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  transition: background 0.2s;
}

.btn-icon-status {
  color: var(--secondary);
}
.btn-icon-status:hover {
  background-color: rgba(6, 106, 130, 0.1);
}

.btn-icon-edit {
  color: #d69e2e;
}
.btn-icon-edit:hover {
  background-color: #fefcbf;
}

.btn-icon-delete {
  color: var(--danger);
}
.btn-icon-delete:hover {
  background-color: #fed7d7;
}

.btn-icon-print {
  color: #3182ce;
}
.btn-icon-print:hover {
  background-color: #ebf8ff;
}

/* --- PRINT STYLES --- */
@media print {
  body * {
    visibility: hidden;
  }
  #print-certificate-area,
  #print-certificate-area * {
    visibility: visible;
  }
  #print-certificate-area {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    padding: 40px;
    border: none;
  }
}

/* Hidden Printable Certificate Styling */
#print-certificate-area {
  display: none;
  background: #fff;
  color: #000;
}

.clc-print-template {
  border: 8px double var(--primary);
  padding: 40px;
  position: relative;
}

.print-header {
  text-align: center;
  border-bottom: 3px double var(--secondary);
  padding-bottom: 15px;
  margin-bottom: 30px;
}

.print-title {
  font-size: 26px;
  font-weight: 800;
  color: var(--primary);
  text-transform: uppercase;
  margin-bottom: 5px;
}

.print-body {
  line-height: 2;
  font-size: 16px;
  margin-bottom: 60px;
}

.print-footer {
  display: flex;
  justify-content: space-between;
  margin-top: 50px;
}

.signature-line {
  border-top: 1px solid #000;
  width: 200px;
  text-align: center;
  padding-top: 5px;
  font-weight: 600;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;            /* Space between buttons */
    flex-wrap: nowrap;    /* Keep all buttons in one line */
}

.action-buttons .btn-link-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    cursor: pointer;
    padding: 0;
    margin: 0;
    font-size: 16px;
    text-decoration: none;
}

.action-buttons .btn-link-action:hover {
    transform: scale(1.1);
}

.action-buttons .btn-link-action:nth-child(1) {
    color: #0b7285;
}

.action-buttons .btn-link-action:nth-child(2) {
    color: #f59f00;
}

.action-buttons .btn-link-action:nth-child(3) {
    color: #e03131;
}

.action-buttons .btn-link-action:nth-child(4) {
    color: #1971c2;
}

@media print {
            body * { visibility: hidden; }
            #print-area, #print-area * { visibility: visible; }
            #print-area { position: absolute; left: 0; top: 0; width: 100%; border: 8px double #952323; padding: 40px; display: block !important; }
        }