/* Minimal Modern Design for LIMS/PO App */
:root {
  --primary-color: #1a252f; /* Dark Slate */
  --accent-color: #c0392b; /* Premium Red Accent */
  --bg-color: #ced4da; /* Soft Medium Grey */
  --sidebar-bg: #ffffff;
  --text-color: #2c3e50;
  --text-muted: #95a5a6;
  --border-color: #e0e0e0;
  --card-shadow: 0 10px 25px rgba(0, 0, 0, 0.05); /* Soft, deep shadow */
  --radius: 6px;
}

body {
  font-family: "Inter", "Segoe UI", "Roboto", sans-serif;
  background-color: var(--bg-color);
  color: var(--text-color);
  -webkit-font-smoothing: antialiased;
}

/* --- Login Page --- */
.login-page {
  background: var(--bg-color) !important;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100vh;
  background-image: radial-gradient(#dbe6ea 1px, transparent 1px);
  background-size: 20px 20px;
}

.login-box {
  width: 420px;
  margin: 0 auto;
}

.login-logo {
  margin-bottom: 30px;
  text-align: center;
}

.login-logo a {
  color: var(--primary-color) !important;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.5px;
  text-transform: capitalize;
}

.login-box-body {
  background: #ffffff;
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
  padding: 50px;
  border: 1px solid rgba(255, 255, 255, 0.8);
}

.login-box-msg {
  font-size: 28px;
  font-weight: 800; /* Extra Bold */
  margin: 0 auto 30px auto; /* Centered with bottom margin */
  letter-spacing: 1px;
  color: var(--primary-color);
  text-transform: uppercase;
  padding-bottom: 10px; /* Space between text and line */
  border-bottom: 2px solid #808080; /* Medium Grey Underline */
  display: table; /* To make width fit content */
}

.form-group {
  margin-bottom: 20px;
}

.form-control {
  border-radius: var(--radius);
  box-shadow: none;
  border: 1px solid #ced4da;
  background-color: #f1f3f5;
  height: 48px;
  padding: 10px 15px;
  transition: all 0.3s ease;
  font-size: 14px;
  color: #333;
}

.form-control:focus {
  border-color: var(--primary-color);
  background-color: #fff;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.03);
}

.form-control-feedback {
  line-height: 48px !important;
  color: #b0bec5;
}

.btn-primary {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
  color: #fff;
  height: 48px !important;
  border-radius: var(--radius) !important;
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 0.5px;
  box-shadow: 0 4px 12px rgba(44, 62, 80, 0.2);
  transition:
    transform 0.2s,
    box-shadow 0.2s;
}

.btn-primary.btn-sm {
  height: 34px !important;
  line-height: normal !important;
  padding: 0 10px !important;
  font-size: 12px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.btn-primary:hover,
.btn-primary:active,
.btn-primary:focus {
  background-color: #161f28;
  border-color: #161f28;
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 6px 15px rgba(44, 62, 80, 0.3);
}

.btn-success {
  background-color: #086f3e; /* Dark Green */
  border-color: #065430;
  color: #fff;
}

.btn-success:hover {
  background-color: #065430;
}

.btn-warning {
  background-color: #f1c40f;
  border-color: #f39c12;
  color: #fff;
}

.btn-danger {
  background-color: var(--accent-color) !important;
  border-color: var(--accent-color) !important;
  color: #fff;
  height: 48px !important;
  border-radius: var(--radius) !important;
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 0.5px;
  box-shadow: 0 4px 12px rgba(192, 57, 43, 0.2);
  transition:
    transform 0.2s,
    box-shadow 0.2s;
}

.btn-danger:hover,
.btn-danger:active,
.btn-danger:focus {
  background-color: #a93226 !important;
  border-color: #a93226 !important;
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 6px 15px rgba(192, 57, 43, 0.3);
}

.btn-danger.btn-sm {
  height: 34px !important;
  line-height: normal !important;
  padding: 0 10px !important;
  font-size: 12px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.btn-danger.btn-xs {
  height: 26px !important;
  width: 26px !important;
  line-height: normal !important;
  padding: 0 !important;
  font-size: 11px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  border-radius: 4px !important;
}

.btn-info {
  background-color: var(--accent-color);
  border-color: #2980b9;
  color: #fff;
}

.btn-default {
  background-color: #ecf0f1;
  border-color: #bdc3c7;
  color: #333;
}

.btn-default:hover {
  background-color: #e6e6e6;
  border-color: #adadad;
}

/* --- Admin Panel Layout --- */
.wrapper {
  background-color: var(--bg-color);
}

.main-header .logo {
  background-color: #fff;
  color: var(--primary-color);
  border-bottom: 1px solid var(--border-color);
  height: 60px;
  line-height: 60px;
  font-weight: 600;
}

.main-header .navbar {
  background-color: #fff;
  border-bottom: 1px solid var(--border-color);
  margin-left: 230px;
  height: 60px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.main-header .sidebar-toggle {
  color: var(--text-color);
  padding: 20px 15px;
}

.main-header .sidebar-toggle:hover {
  background-color: #f9f9f9;
  color: var(--accent-color);
}

.main-sidebar,
.left-side {
  background-color: var(--sidebar-bg);
  padding-top: 60px;
  border-right: 1px solid var(--border-color);
}

.user-panel {
  display: none; /* Cleaner look without user panel in sidebar */
}

/* --- Sidebar Menu Redesign --- */
.sidebar-menu {
  margin-top: 20px;
  padding: 0 10px; /* Add padding to container for floating effect */
}

.sidebar-menu > li.header {
  background-color: transparent;
  color: var(--text-muted);
  padding: 15px 15px 5px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  margin-bottom: 5px;
}

.sidebar-menu > li {
  margin-bottom: 5px;
}

.sidebar-menu > li > a {
  padding: 12px 15px;
  color: #000000 !important;
  font-weight: 600; /* Bolder for clarity */
  font-size: 14px; /* Increased size */
  border-radius: var(--radius);
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
  letter-spacing: 0.3px; /* Slightly improved spacing */
}

/* Icon alignment */
.sidebar-menu > li > a > i {
  width: 24px;
  text-align: center;
  margin-right: 12px;
  font-size: 18px;
  color: #000000 !important; /* Force Icon Black */
  transition: all 0.3s;
}

/* Hover State */
.sidebar-menu > li:hover > a {
  background-color: #fff;
  color: var(--primary-color);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
  transform: translateY(-2px);
}

.sidebar-menu > li:hover > a > i {
  color: var(--accent-color);
}

/* Global Active State for ALL Levels (L1, L2, L3) */
body.skin-blue .sidebar-menu li.active > a,
body.skin-blue .sidebar-menu li.active.treeview > a,
body.skin-blue .sidebar-menu .treeview-menu li.active > a,
body.skin-blue .sidebar-menu .treeview-menu li.active.treeview > a,
.sidebar-menu li.active > a,
.sidebar-menu .treeview-menu li.active > a {
  background: linear-gradient(135deg, var(--primary-color), #34495e) !important;
  color: #ffffff !important;
  box-shadow: 0 8px 20px rgba(44, 62, 80, 0.3) !important;
  font-weight: 700 !important;
  padding-top: 12px !important;
  padding-bottom: 12px !important;
  font-size: 14px !important;
  opacity: 1 !important;
}

body.skin-blue .sidebar-menu li.active > a i,
body.skin-blue .sidebar-menu .treeview-menu li.active > a i,
.sidebar-menu li.active > a i,
.sidebar-menu .treeview-menu li.active > a i {
  color: #ffffff !important;
  opacity: 1 !important;
}

/* Treeview Submenu */
.sidebar-menu > li > .treeview-menu {
  background-color: transparent !important;
  margin: 5px 0 10px 0;
  padding-left: 10px;
}

.sidebar-menu > li > .treeview-menu > li > a {
  color: #000000 !important;
  padding: 8px 15px 8px 35px;
  font-size: 13.5px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  transition: all 0.2s;
  position: relative;
  font-weight: 500;
  letter-spacing: 0.2px;
}

/* Force submenu icons to be black */
.sidebar-menu .treeview-menu > li > a > i {
  color: #000000 !important;
}

/* Submenu Hover */
/* Submenu Hover */
.sidebar-menu > li > .treeview-menu > li > a:hover {
  color: var(--primary-color);
  background-color: rgba(44, 62, 80, 0.08); /* Soft dark contrast */
  transform: translateX(5px);
  font-weight: 600;
}

/* Submenu Item Styles (General) */
.sidebar-menu .treeview-menu li > a {
  transition: all 0.2s;
  border-radius: var(--radius);
}

.sidebar-menu .treeview-menu li.active > a > i {
  transform: scale(1.5);
}

/* --- Content Content --- */
.content-wrapper {
  background-color: var(--bg-color);
  margin-left: 230px; /* Adjust if sidebar width changes */
  padding-top: 60px;
}

.content-header {
  padding: 20px 20px 10px;
}

.content-header > h1 {
  font-size: 22px;
  font-weight: 600;
  color: #333;
}

.box,
.card {
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
  border: none;
  border-top: none; /* Remove colored tops */
  background: #fff;
  margin-bottom: 20px;
}

.box-header {
  padding: 15px 20px;
  border-bottom: 1px solid #f0f0f0;
}

.box-header .box-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--primary-color);
}

.box-body {
  padding: 20px;
}

/* --- Tables --- */
.table {
  width: 100%;
  margin-bottom: 0;
}

.table > thead > tr > th {
  background-color: #fafafa;
  border-bottom: 2px solid #eee;
  color: #666;
  font-weight: 600;
  text-transform: uppercase;
  font-size: 12px;
  padding: 12px 15px;
}

.table > tbody > tr > td {
  padding: 12px 15px;
  border-top: 1px solid #f0f0f0;
  color: #555;
  vertical-align: middle;
}

.table-striped > tbody > tr:nth-of-type(odd) {
  background-color: #fcfcfc;
}

.btn-action {
  padding: 4px 8px;
  font-size: 12px;
  border-radius: 4px;
}

/* --- Alerts --- */
.alert {
  border-radius: var(--radius);
  border: none;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

/* --- Footer --- */
.main-footer {
  background: #fff;
  border-top: 1px solid var(--border-color);
  color: #888;
  font-size: 13px;
  padding: 15px 20px;
  margin-left: 230px;
}

/* --- User Menu Redesign --- */
.navbar-nav > .user-menu > .dropdown-menu > .user-header {
  background-color: var(--primary-color) !important;
  color: #fff;
}

.navbar-nav > .user-menu > .dropdown-menu > li.user-header > p {
  color: rgba(255, 255, 255, 0.8);
}

.navbar-nav > .user-menu > .dropdown-menu {
  border: none;
  border-radius: var(--radius);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  width: 280px;
}

.navbar-nav > .user-menu > .dropdown-menu > .user-footer {
  background-color: #f9f9f9;
  border-radius: 0 0 var(--radius) var(--radius);
}

/* --- Datepicker Minimalist --- */
.datepicker {
  border-radius: var(--radius) !important;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  border: none !important;
  padding: 10px !important;
}
.datepicker table tr td.active,
.datepicker table tr td.active:hover {
  background-color: var(--primary-color) !important;
  border-radius: 4px;
}

/* Responsive tweaks */
@media (max-width: 767px) {
  .main-header .navbar {
    margin-left: 0;
  }
  .content-wrapper {
    margin-left: 0;
  }
  .main-footer {
    margin-left: 0;
  }
  .login-box {
    width: 90%;
  }
}

/* --- Fix for Table Action Buttons Size --- */
/* Enforce equal square size for Edit (Ubah), Delete (Hapus), and Detail (Detil) buttons */
.table .btn-sm[title="Ubah"],
.table .btn-sm[title="Hapus"],
.table .btn-sm[title="Detil"],
.table .btn.btn-table-action,
.table .btn-sm[data-original-title="Ubah"],
.table .btn-sm[data-original-title="Hapus"],
.table .btn-sm[data-original-title="Detil"] {
  width: 34px !important;
  height: 34px !important;
  min-width: 34px !important;
  padding: 0 !important;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  line-height: normal !important; /* Reset line-height */
}

.table .btn-sm[title="Ubah"] i,
.table .btn-sm[title="Hapus"] i,
.table .btn-sm[title="Detil"] i,
.table .btn-table-action i,
.table .btn-sm[data-original-title="Ubah"] i,
.table .btn-sm[data-original-title="Hapus"] i,
.table .btn-sm[data-original-title="Detil"] i {
  line-height: normal !important;
  font-size: 14px;
}

/* --- Fix for Collapse/Minimize Button --- */
.box-tools .btn[data-widget="collapse"],
.box-header .btn[data-widget="collapse"] {
  width: 34px !important;
  height: 34px !important;
  min-width: 34px !important;
  padding: 0 !important;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
}

/* --- Fix for 'Tambah' Social Button --- */
.btn-social {
  height: 34px !important;
  line-height: normal !important; /* Adjust for vertical centering of text */
  padding-left: 48px !important; /* Space for icon */
  padding-right: 15px !important;
  position: relative;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
}

/* --- Fix for 'Simpan' / Submit Buttons --- */
.btn-submit {
  height: 34px !important;
  line-height: normal !important;
  padding: 0 20px !important; /* Horizontal padding for text buttons */
  font-size: 14px !important;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
}

.btn-social > :first-child {
  width: 34px !important;
  height: 34px !important;
  line-height: 34px !important;
  position: absolute;
  left: 0;
  top: 0;
  border-right: 1px solid rgba(255, 255, 255, 0.2); /* Softer border */
  font-size: 14px !important;
  text-align: center;
}

/* Force Active State White (High Specificity) */
.sidebar-menu li.active > a,
.sidebar-menu li.active > a > i,
.sidebar-menu li.treeview.active > a,
.sidebar-menu li.treeview.active > a > i,
.sidebar-menu .treeview-menu li.active > a,
.sidebar-menu .treeview-menu li.active > a > i {
  color: #ffffff !important;
}

body .sidebar-menu li.active > a,
body .sidebar-menu .treeview-menu li.active > a {
  color: #ffffff !important;
}
