/* 
   DeviceHub CSS - Adaptado do CRM Theme
   Este arquivo contém apenas os estilos principais do sistema
*/

:root {
  --primary-color: #4e73df;
  --secondary-color: #6c757d;
  --success-color: #1cc88a;
  --danger-color: #e74a3b;
  --warning-color: #f6c23e;
  --info-color: #36b9cc;
  --light-color: #f8f9fc;
  --dark-color: #5a5c69;
  --body-color: #858796;
  --bs-body-font-family: 'Nunito', sans-serif;
}

/* Estilos Globais */
body {
  font-family: var(--bs-body-font-family);
  font-size: 0.875rem;
  background-color: var(--light-color);
  color: var(--dark-color);
}

.page-wrapper {
  display: flex;
  position: relative;
}

/* Sidebar */
.left-sidebar {
  width: 260px;
  position: fixed;
  z-index: 10;
  height: 100%;
  top: 0;
  left: 0;
  transition: all 0.3s ease;
}

.left-sidebar.collapsed {
  margin-left: -260px;
}

.sidebar-nav {
  padding: 20px 10px;
}

.sidebar-item {
  position: relative;
  margin-bottom: 10px;
  list-style: none;
}

.sidebar-link {
  color: rgba(255, 255, 255, 0.85);
  display: flex;
  align-items: center;
  text-decoration: none;
  padding: 12px 15px;
  border-radius: 7px;
  white-space: nowrap;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s ease;
}

.sidebar-link:hover {
  color: white;
  background: rgba(255, 255, 255, 0.15);
}

.sidebar-link.active {
  color: white;
  background: rgba(255, 255, 255, 0.2);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.hide-menu {
  margin-left: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: 0.2px;
}

.sidebar-item.active {
  background: transparent;
}

.sidebar-item.active > .sidebar-link {
  color: white;
  background: rgba(255, 255, 255, 0.2);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.sidebar-item.selected > .sidebar-link {
  color: white;
  background: rgba(255, 255, 255, 0.15);
}

.sidebar-divider {
  height: 0;
  margin: 1rem 0;
  overflow: hidden;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  opacity: 0.5;
}

.sidebar-link i, .sidebar-link span:first-child {
  font-size: 16px;
  width: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.brand-logo {
  padding: 20px 15px 15px;
  text-align: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  margin-bottom: 10px;
}

/* Body wrapper */
.body-wrapper {
  min-height: 100vh;
  margin-left: 260px;
  flex: 1;
  transition: all 0.3s ease;
  width: calc(100% - 260px);
  background-color: #f8f9fa;
}

.body-wrapper.expanded {
  margin-left: 0;
  width: 100%;
}

/* Header */
.app-header {
  background: white;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  padding: 0 15px;
  position: sticky;
  top: 0;
  z-index: 9;
}

/* Cards */
.card {
  border: none;
  box-shadow: 0 0.15rem 1.75rem 0 rgba(58, 59, 69, 0.1);
  border-radius: 0.5rem;
  margin-bottom: 1.5rem;
}

.card-header {
  font-weight: 600;
  background: transparent;
  border-bottom: 1px solid rgba(0, 0, 0, 0.125);
  padding: 1.25rem;
}

.card-body {
  padding: 1.25rem;
}

/* Buttons */
.btn {
  border-radius: 0.35rem;
  font-size: 0.85rem;
  padding: 0.4rem 1rem;
}

.btn-primary {
  color: white;
}

/* Tables */
.table thead th {
  border-top: none;
  font-weight: 600;
  vertical-align: middle;
  padding: 0.75rem;
}

/* Dropdown */
.dropdown-menu {
  font-size: 0.85rem;
  box-shadow: 0 0.15rem 1.75rem 0 rgba(58, 59, 69, 0.15);
  border: none;
  border-radius: 0.35rem;
}

.dropdown-item {
  padding: 0.5rem 1rem;
}

/* Alerts */
.alert {
  border-radius: 0.35rem;
  padding: 0.75rem 1.25rem;
}

/* Form elements */
.form-control {
  border-radius: 0.35rem;
  font-size: 0.85rem;
  padding: 0.5rem 1rem;
}

.form-control:focus {
  box-shadow: 0 0 0 0.25rem rgba(78, 115, 223, 0.25);
}

/* Loading mask */
#loading-mask {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.spinner-container {
  background-color: white;
  padding: 30px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  text-align: center;
}

.spinner-border {
  width: 3rem;
  height: 3rem;
}

.spinner-text {
  margin-top: 15px;
  font-weight: 500;
}

/* Responsive */
@media (max-width: 991.98px) {
  .left-sidebar {
    margin-left: -260px;
  }
  
  .left-sidebar.show-sidebar {
    margin-left: 0;
  }
  
  .body-wrapper {
    margin-left: 0;
  }
}