html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

/* Modern Black Navbar Styling */
.navbar.bg-black {
  background-color: #000 !important;
  padding: 0.75rem 1rem;
}

.navbar-dark .navbar-nav .nav-link {
  color: #fff !important;
  font-weight: 500;
  font-size: 0.95rem;
  letter-spacing: 0.3px;
  padding: 0.75rem 1.25rem;
  transition: all 0.3s ease;
  text-transform: uppercase;
  font-size: 0.875rem;
}

.navbar-dark .navbar-nav .nav-link:hover,
.navbar-dark .navbar-nav .nav-link:focus {
  color: #fff !important;
  background-color: rgba(255,255,255,0.1);
}

/* Logout button styled as nav link */
.navbar-dark .navbar-nav form button.nav-link {
  color: #fff !important;
  font-weight: 500;
  font-size: 0.875rem;
  letter-spacing: 0.3px;
  padding: 0.75rem 1.25rem;
  transition: all 0.3s ease;
  text-transform: uppercase;
  border: none;
  background: none;
  cursor: pointer;
  text-decoration: none;
}

.navbar-dark .navbar-nav form button.nav-link:hover,
.navbar-dark .navbar-nav form button.nav-link:focus {
  color: #fff !important;
  background-color: rgba(255,255,255,0.1);
  text-decoration: none;
}

.navbar-dark .navbar-nav .dropdown-toggle::after {
  margin-left: 0.5rem;
}

/* Dark dropdowns */
.dropdown-menu-dark {
  background-color: #1a1a1a;
  border: 1px solid rgba(255,255,255,0.1);
}

.dropdown-menu-dark .dropdown-item {
  color: #fff;
  padding: 0.65rem 1.25rem;
  font-size: 0.9rem;
  transition: all 0.2s ease;
}

.dropdown-menu-dark .dropdown-item:hover,
.dropdown-menu-dark .dropdown-item:focus {
  background-color: rgba(255,255,255,0.15);
  color: #fff;
}

/* Submenu indicator (arrow) */
.dropdown-submenu > a::after {
  content: '\25B6'; /* Right arrow */
  float: right;
  margin-left: 0.5rem;
  font-size: 0.7rem;
  margin-top: 0;
  vertical-align: middle;
  line-height: inherit;
  color: #fff; /* White color matching navbar */
}

/* Submenu positioning */
.dropdown-submenu {
  position: relative;
}

.dropdown-submenu > .dropdown-menu {
  top: 0;
  left: 100%;
  margin-top: -1px;
  margin-left: 0;
}

/* Show submenu on hover */
.dropdown-submenu:hover > .dropdown-menu {
  display: block;
}

/* Responsive navbar */
@media (max-width: 991px) {
  .navbar-collapse {
    background-color: #000;
    padding: 1rem;
    margin-top: 0.5rem;
  }
  
  .navbar-dark .navbar-nav .nav-link {
    padding: 0.75rem 1rem;
  }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

/* Sticky Footer Setup */
html {
  position: relative;
  min-height: 100%;
}

html, body {
  height: 100%;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background-repeat: no-repeat;
  background-attachment: fixed;
  background-position: center;
  /* ensure any background image covers full viewport */
  background-size: cover;
  -webkit-font-smoothing: antialiased;
  /* Light professional background for application pages */
  background-color: #f5f7fa;
  margin: 0;
  padding-bottom: 60px; /* Height of fixed footer */
}

/* Add padding to page wrapper to prevent content from going behind footer */
.page-wrapper {
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
  padding-bottom: 20px; /* Extra padding for spacing */
}

.page-wrapper > .container {
  flex: 1 0 auto;
}

/* Footer stays at bottom */
.footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  width: 100%;
  padding: 1rem 0;
  background-color: #f8f9fa;
  border-top: 1px solid #dee2e6;
}

/* Professional Content Area Styling */
.container main {
  background-color: #ffffff;
  padding: 2rem;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  margin-top: 1.5rem;
  margin-bottom: 2rem;
  max-width: 1400px;
  margin-left: auto;
  margin-right: auto;
}

/* Form Table Container */
.form-table-container {
  border: 1px solid #666;
  background-color: #fff;
  margin: 1rem 0;
}

.form-table-header {
  background: linear-gradient(90deg, #031125, #0d3969);
  color: #ffffff;
  padding: 0.75rem 1rem;
  font-weight: 600;
  font-size: 1rem;
  text-align: left;
  border-radius: 2px;
  transition: all 0.2s ease;
}

/* Standard page header for card-based layouts */
.page-header,
.card-header.bg-primary {
  background: linear-gradient(90deg, #031125, #0d3969) !important;
  color: #ffffff !important;
  padding: 0.75rem 1rem;
  font-weight: 600;
  font-size: 1rem;
  border-radius: 2px;
  transition: all 0.2s ease;
}

.page-header h4,
.card-header h4,
.card-header.bg-primary h4 {
  margin: 0;
  color: #ffffff !important;
  font-weight: 600;
  font-size: 1rem;
}

.form-table-subheader {
  background-color: #d3d3d3;
  color: #000;
  padding: 0.5rem 1rem;
  font-weight: 600;
  font-size: 0.9rem;
  border-bottom: 1px solid #999;
}

/* Form Table Styling */
.form-table {
  width: 100%;
  border-collapse: collapse;
  background-color: #fff;
  table-layout: fixed;
}

.form-table tr {
  border-bottom: 1px solid #ddd;
}

.form-table td {
  padding: 0.1rem 0.75rem;
  vertical-align: middle;
  border-right: 1px solid #ddd;
}

.form-table td:last-child {
  border-right: none;
}

.form-label-cell {
  background-color: #f8f8f8;
  font-weight: 500;
  color: #333;
  font-size: 0.85rem;
  width: 20%;
  text-align: left;
  padding-left: 0.75rem;
  white-space: nowrap;
}

.form-input-cell {
  background-color: #fff;
  padding: 0.4rem 0.75rem;
  width: 80%;
}

.form-button-cell {
  text-align: center;
  padding: 0.75rem;
  background-color: #fff;
  border-right: none !important;
}

/* Compact Two-Column Form Layout - 60% width */
.container {
  max-width: 75% !important;
  margin-left: auto !important;
  margin-right: auto !important;
}

@media (max-width: 1400px) {
  .container {
    max-width: 85% !important;
  }
}

@media (max-width: 992px) {
  .container {
    max-width: 95% !important;
  }
  
  .form-label-cell {
    width: 25%;
  }
  
  .form-input-cell {
    width: 25%;
  }
}

@media (max-width: 768px) {
  .container {
    max-width: 98% !important;
  }
  
  .form-table td {
    display: block;
    width: 100% !important;
    border-right: none;
  }
  
  .form-label-cell {
    background-color: #f0f0f0;
    border-bottom: 1px solid #ddd;
  }
}

/* Professional Page Headers */
h1, h2, h3, h4, h5, h6 {
  color: #2c3e50;
  font-weight: 600;
  margin-bottom: 1rem;
}

h2 {
  font-size: 1.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid #e1e8ed;
  margin-bottom: 1rem;
}

/* Professional Form Styling */
.form-label {
  font-weight: 500;
  color: #495057;
  margin-bottom: 0.35rem;
  font-size: 0.85rem;
}

/* Horizontal form labels */
.col-form-label {
  font-weight: 500;
  color: #495057;
  font-size: 0.85rem;
  padding-top: calc(0.5rem + 1px);
  padding-bottom: calc(0.5rem + 1px);
  margin-bottom: 0;
  text-align: right;
  padding-right: 1rem;
}

.form-control, .form-select {
  border: 1px solid #ced4da;
  padding: 0.375rem 0.5rem;
  border-radius: 3px;
  font-size: 0.85rem;
  transition: border-color 0.2s, box-shadow 0.2s;
  height: calc(1.8rem + 2px);
  width: 100%;
}

.form-control:focus, .form-select:focus {
  border-color: #4a90e2;
  box-shadow: 0 0 0 0.1rem rgba(74, 144, 226, 0.15);
  outline: 0;
}

/* Row spacing for horizontal forms */
.row.mb-2 {
  margin-bottom: 0.5rem;
}

.row.mb-3 {
  margin-bottom: 0.75rem;
}

.form-control:focus, .form-select:focus {
  border-color: #4a90e2;
  box-shadow: 0 0 0 0.2rem rgba(74, 144, 226, 0.15);
  outline: 0;
}

/* Professional Table Styling */
table {
  background-color: #fff;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

table thead th {
  background-color: #34495e;
  color: #ffffff;
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.85rem;
  letter-spacing: 0.5px;
  padding: 1rem;
  border: none;
}

table tbody td {
  padding: 0.875rem 1rem;
  border-bottom: 1px solid #e9ecef;
  color: #495057;
  font-size: 0.95rem;
}

table tbody tr:hover {
  background-color: #f8f9fa;
}

table tbody tr:last-child td {
  border-bottom: none;
}

/* Professional Button Styling */
.btn {
  padding: 0.375rem 1rem;
  font-weight: 500;
  border-radius: 3px;
  font-size: 0.85rem;
  transition: all 0.2s ease;
  letter-spacing: 0.3px;
}

.btn-sm {
  padding: 0.25rem 0.75rem;
  font-size: 0.8rem;
}

.btn-primary {
  background-color: #4a90e2;
  border-color: #4a90e2;
}

.btn-primary:hover {
  background-color: #357abd;
  border-color: #357abd;
}

.btn-secondary {
  background-color: #6c757d;
  border-color: #6c757d;
}

.btn-secondary:hover {
  background-color: #5a6268;
  border-color: #5a6268;
}

.btn-outline-secondary {
  color: #6c757d;
  border-color: #ced4da;
  font-size: 0.8rem;
  padding: 0.25rem 0.75rem;
}

.btn-outline-secondary:hover {
  background-color: #6c757d;
  border-color: #6c757d;
  color: #fff;
}

/* Professional Alert Styling */
.alert {
  border-radius: 6px;
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
  border: none;
  font-size: 0.95rem;
}

.alert-success {
  background-color: #d4edda;
  color: #155724;
  border-left: 4px solid #28a745;
}

.alert-danger {
  background-color: #f8d7da;
  color: #721c24;
  border-left: 4px solid #dc3545;
}

.alert-info {
  background-color: #d1ecf1;
  color: #0c5460;
  border-left: 4px solid #17a2b8;
}

/* Professional Card/Panel Styling */
.card {
  border: none;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  margin-bottom: 1.5rem;
}

.card-header {
  background-color: #34495e;
  color: #ffffff;
  font-weight: 600;
  padding: 1rem 1.25rem;
  border-bottom: none;
  border-radius: 8px 8px 0 0;
}

/* Form Helper Text */
.form-text {
  font-size: 0.75rem;
  color: #6c757d;
  margin-top: 0.1rem;
}

/* Validation Messages */
.text-danger {
  font-size: 0.75rem;
  margin-top: 0.1rem;
   /* display: block; */
}

/* Professional Input Groups */
.input-group {
  border-radius: 3px;
  overflow: hidden;
}

.input-group .form-control {
  border-right: none;
  height: calc(1.8rem + 2px);
}

.input-group .btn {
  border-left: 1px solid #ced4da;
  height: calc(1.8rem + 2px);
}

/* Radio Button Styling */
input[type="radio"] {
  margin-right: 0.35rem;
  cursor: pointer;
}

/* Compact instruction text */
.text-muted, .text-dark {
  font-size: 0.85rem;
  margin-bottom: 0.5rem;
}

/* Multi-level dropdown submenu styles */
.dropdown-submenu {
  position: relative;
}

.dropdown-submenu > .dropdown-menu {
  top: 0;
  left: 100%;
  margin-left: 0.1rem;
}

/* make nested submenu appear on top in case of overflow */
.dropdown-menu .dropdown-submenu .dropdown-menu {
  left: 100%;
  top: 0;
}

/* small-screen adjustments: let submenus be full width stacked */
@media (max-width: 991px) {
  .dropdown-submenu > .dropdown-menu {
    left: 0;
    position: relative;
    margin-left: 0;
  }
}

/* Global Form Control Fixes */
.form-select,
select.form-control {
    appearance: auto;
    -webkit-appearance: menulist;
    -moz-appearance: menulist;
    background-color: #fff !important;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 16px 12px;
    padding-right: 2.5rem !important;
    cursor: pointer;
    height: auto;
    min-height: 38px;
}

.form-select option {
    background-color: #fff;
    color: #000;
    padding: 0.5rem;
}

.form-select:focus,
select.form-control:focus {
    border-color: #0d3969;
    box-shadow: 0 0 0 0.2rem rgba(13, 57, 105, 0.15);
    outline: none;
    background-color: #fff !important;
}

.form-control {
    background-color: #fff;
    border: 1px solid #ced4da;
}

/* Remove autofill yellow background */
.form-control:-webkit-autofill,
.form-control:-webkit-autofill:hover,
.form-control:-webkit-autofill:focus,
.form-select:-webkit-autofill,
.form-select:-webkit-autofill:hover,
.form-select:-webkit-autofill:focus,
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
select:-webkit-autofill,
select:-webkit-autofill:hover,
select:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0 1000px #fff inset !important;
    -webkit-text-fill-color: #000 !important;
    background-color: #fff !important;
    transition: background-color 5000s ease-in-out 0s;
}

.form-control:disabled,
.form-select:disabled {
    background-color: #e9ecef;
    opacity: 1;
}

/* Inline text-danger for asterisks */
label .text-danger,
.instruction-box .text-danger {
    display: inline !important;
    margin-left: 2px;
}

/* Block text-danger for validation messages */
span.text-danger,
.field-validation-error {
    
    font-size: 0.8rem;
    margin-top: 0.15rem;
    color: #dc3545;
}

/* Exception for inline asterisks in instructions and labels */
.instruction-box .text-danger,
label > .text-danger {
    display: inline !important;
}
