/* =========================================
   1. VARIABLES & RESET
   ========================================= */
:root {
  /* Kneron Brand Colors */
  --k-blue-primary: #0061F2;  /* Vibrant Blue for primary actions */
  --k-blue-dark: #004bb3;     /* Hover state */
  --k-black: #111111;         /* Deep black for sidebar */
  --k-gray-dark: #1A1D20;     /* Sidebar background */
  --k-gray-medium: #2C3034;   /* Borders */
  --k-gray-light: #F8F9FA;    /* Page background */
  
  /* Status Colors */
  --k-success: #198754;
  --k-warning: #fd7e14;
  --k-danger: #dc3545;

  /* Spacing & Layout */
  --sidebar-width: 260px;
  --header-height: 60px;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background-color: var(--k-gray-light);
  color: #212529;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  letter-spacing: -0.02em;
}

/* Monospace for Code */
pre, code, .font-monospace {
  font-family: 'JetBrains Mono', 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace !important;
}

/* =========================================
   2. SIDEBAR NAVIGATION
   ========================================= */
.sidebar {
  width: var(--sidebar-width);
  height: 100vh;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1040; /* Above Bootstrap navbar default */
  padding-top: 0;
  background-color: var(--k-gray-dark);
  border-right: 1px solid var(--k-gray-medium);
  overflow-y: auto;
  transition: transform 0.3s ease-in-out;
}

.sidebar-logo {
  height: var(--header-height);
  background-color: #000;
  display: flex;
  align-items: center;
  padding-left: 1.5rem;
  border-bottom: 1px solid var(--k-gray-medium);
}

.sidebar-logo img {
  opacity: 0.9;
}

.sidebar-heading {
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  font-weight: 600;
  color: #6c757d;
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}

.sidebar .nav-link {
  color: rgba(255, 255, 255, 0.65) !important;
  font-size: 0.9rem;
  padding: 0.5rem 1.5rem;
  font-weight: 400;
  transition: all 0.2s ease-in-out;
  border-left: 3px solid transparent;
}

.sidebar .nav-link:hover {
  color: #fff !important;
  background-color: rgba(255, 255, 255, 0.05);
}

.sidebar .nav-link.active {
  color: #fff !important;
  background-color: rgba(0, 97, 242, 0.1); /* Subtle blue tint */
  border-left-color: var(--k-blue-primary);
}

.sidebar .nav-link i {
  width: 20px;
  text-align: center;
  opacity: 0.8;
}

/* Sidebar Overlay (Mobile) */
.sidebar-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1030;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease-in-out;
}

.sidebar-overlay.show {
  opacity: 1;
  visibility: visible;
}

/* =========================================
   3. MAIN CONTENT AREA
   ========================================= */
.main-content {
  margin-left: var(--sidebar-width);
  padding: 0;
  min-height: 100vh;
  transition: margin-left 0.3s ease-in-out;
}

/* Header */
.main-header {
  height: var(--header-height);
  background-color: #fff;
  border-bottom: 1px solid #e9ecef;
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 99;
}

.content-wrapper {
  padding: 2rem;
  max-width: 1400px;
  margin: 0 auto;
}

/* =========================================
   4. COMPONENTS
   ========================================= */

/* Cards */
.card {
  border: 1px solid rgba(0,0,0,0.08);
  box-shadow: 0 2px 4px rgba(0,0,0,0.02);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  border-radius: 0.5rem;
}

.hover-card:hover, .hover-lift:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 20px rgba(0,0,0,0.05);
  border-color: rgba(0, 97, 242, 0.2);
}

.card-header {
  background-color: #fff;
  border-bottom: 1px solid rgba(0,0,0,0.05);
  font-weight: 600;
}

/* Terminal Hero Block */
.terminal-window {
  background-color: #1e1e1e;
  border-radius: 8px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.3);
  overflow: hidden;
  font-family: 'JetBrains Mono', monospace;
}

.terminal-header {
  background-color: #2d2d2d;
  padding: 8px 16px;
  display: flex;
  align-items: center;
}

.terminal-dots {
  display: flex;
  gap: 6px;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.dot-red { background-color: #ff5f56; }
.dot-yellow { background-color: #ffbd2e; }
.dot-green { background-color: #27c93f; }

.terminal-body {
  padding: 20px;
  color: #d4d4d4;
  font-size: 0.9rem;
  line-height: 1.6;
}

.cmd-prompt { color: #27c93f; margin-right: 8px; }
.cmd-text { color: #fff; }
.cmd-comment { color: #6a9955; display: block; margin-top: 10px; margin-bottom: 4px; }

/* Tables */
.table th {
  font-weight: 500;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  color: #6c757d;
  background-color: #f8f9fa;
  border-bottom: 2px solid #e9ecef;
}

.table td {
  vertical-align: middle;
}

/* Search Bar */
.search-input-group .input-group-text {
  background-color: #f8f9fa;
  border-right: none;
}

.search-input-group .form-control {
  border-left: none;
  background-color: #f8f9fa;
}

.search-input-group .form-control:focus {
  background-color: #fff;
  box-shadow: none;
  border-color: #dee2e6;
}

/* Badges */
.badge {
  font-weight: 500;
  letter-spacing: 0.02em;
  padding: 0.4em 0.8em;
}

/* Icon Squares */
.icon-square {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
}

/* Buttons */
.btn-primary {
  background-color: var(--k-blue-primary);
  border-color: var(--k-blue-primary);
}

.btn-primary:hover {
  background-color: var(--k-blue-dark);
  border-color: var(--k-blue-dark);
}

/* Utilities */
.text-muted-sm {
  font-size: 0.85rem;
  color: #6c757d;
}

/* =========================================
   5. MEDIA QUERIES (Mobile)
   ========================================= */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }
  
  .sidebar.show {
    transform: translateX(0);
  }
  
  .main-content {
    margin-left: 0;
  }
  
  .main-header {
    padding: 0 1rem;
  }
  
  .content-wrapper {
    padding: 1rem;
  }
  
  /* Adjust search bar width on mobile */
  .search-input-group input {
    width: auto;
    min-width: 0;
  }
}
