﻿html {
  font-size: 13px;
}

@media (min-width: 768px) {
  html {
    font-size: 14px;
  }
}

@media (min-width: 1200px) {
  html {
    font-size: 15px;
  }
}

.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;
}

html {
  position: relative;
  min-height: 100%;
}

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  font-size: 0.9rem;
}

/* Global compact styles for lower resolution displays */
.compact-interface h1 {
  font-size: 1.8rem !important;
}
.compact-interface h2 {
  font-size: 1.5rem !important;
}
.compact-interface h3 {
  font-size: 1.3rem !important;
}
.compact-interface h4 {
  font-size: 1.2rem !important;
}
.compact-interface h5 {
  font-size: 1.1rem !important;
}
.compact-interface h6 {
  font-size: 1rem !important;
}

/* Apply compact styles globally */
h1 {
  font-size: 1.8rem;
}
h2 {
  font-size: 1.5rem;
}
h3 {
  font-size: 1.3rem;
}
h4 {
  font-size: 1.2rem;
}
h5 {
  font-size: 1.1rem;
}
h6 {
  font-size: 1rem;
}

/* Compact form controls */
.form-control-compact {
  padding: 0.25rem 0.5rem;
  font-size: 0.85rem;
}
.form-select-compact {
  padding: 0.25rem 0.5rem;
  font-size: 0.85rem;
}
.btn-compact {
  padding: 0.25rem 0.75rem;
  font-size: 0.85rem;
}

/* Compact card styles */
.card-compact .card-header {
  padding: 0.5rem 0.75rem;
  font-size: 0.9rem;
}
.card-compact .card-body {
  padding: 0.75rem;
}

/* Fix card header layout issues */
.card .card-header {
  min-height: 3rem; /* Ensure minimum height for proper layout */
}

.card .card-header .d-flex {
  align-items: flex-start !important;
  gap: 0.5rem; /* Add gap between title and dropdown */
}

.card .card-header .card-title {
  flex: 1;
  min-width: 0; /* Allow text truncation */
  line-height: 1.3;
  word-break: break-word;
}

.card .card-header .dropdown {
  flex-shrink: 0; /* Prevent dropdown from shrinking */
  margin-left: auto;
}

.card .card-header .dropdown .btn {
  min-width: 2rem;
  min-height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Global responsive adjustments */
@media (max-width: 1024px) {
  .container-fluid {
    padding: 0.5rem;
  }
  .card {
    margin-bottom: 0.75rem !important;
  }
  .mb-3 {
    margin-bottom: 0.75rem !important;
  }
  .mb-4 {
    margin-bottom: 1rem !important;
  }
  .pt-4 {
    padding-top: 1rem !important;
  }
  .ps-4,
  .pe-4 {
    padding-left: 0.75rem !important;
    padding-right: 0.75rem !important;
  }
}

.footer {
  position: static;
  bottom: 0;
  width: 100%;
  white-space: nowrap;
  line-height: 60px;
}

.bg-primary {
  background-color: #00904e !important;
}

.btn-primary {
  background-color: #00904e !important;
}

.btn-primary:hover {
  opacity: 0.8;
}

.text-primary {
  color: #00904e !important;
}

/* Custom styles */
.avatar {
  font-weight: bold;
  font-size: 14px;
}

.card {
  border-radius: 10px;
  box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

.card-header {
  border-radius: 10px 10px 0 0 !important;
}

.btn {
  border-radius: 6px;
}

.form-control,
.form-select {
  border-radius: 6px;
}

.table th {
  border-top: none;
  font-weight: 600;
  /*color: #495057;*/
  color: white;
}

.badge {
  font-size: 0.75em;
}

.hero-section {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 400px;
}

.bg-gradient-primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.text-truncate {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Platform specific colors */
.fab.fa-facebook {
  color: #1877f2;
}

.fab.fa-tiktok {
  color: #000000;
}

.fas.fa-comment-dots {
  color: #0068ff;
}

/* Status badges */
.badge.bg-success {
  background-color: #28a745 !important;
}

.badge.bg-danger {
  background-color: #dc3545 !important;
}

.badge.bg-warning {
  background-color: #ffc107 !important;
  color: #000 !important;
}

.badge.bg-info {
  background-color: #17a2b8 !important;
}

.badge.bg-primary {
  background-color: #007bff !important;
}

/* Responsive adjustments for compact interface */
@media (max-width: 768px) {
  .hero-section {
    min-height: 300px;
  }

  .display-4 {
    font-size: 1.75rem; /* Reduced */
  }

  .card-body {
    padding: 0.75rem; /* Reduced */
  }

  h1 {
    font-size: 1.5rem !important;
  }
  h2 {
    font-size: 1.3rem !important;
  }
  h3 {
    font-size: 1.2rem !important;
  }
  h4 {
    font-size: 1.1rem !important;
  }
  h5 {
    font-size: 1rem !important;
  }
  h6 {
    font-size: 0.9rem !important;
  }
}

@media (max-width: 1024px) {
  .container-fluid {
    padding: 0.5rem !important;
  }

  .card {
    margin-bottom: 0.75rem !important;
  }

  .mb-3 {
    margin-bottom: 0.75rem !important;
  }

  .mb-4 {
    margin-bottom: 1rem !important;
  }

  .pt-4 {
    padding-top: 1rem !important;
  }

  .ps-4,
  .pe-4 {
    padding-left: 0.75rem !important;
    padding-right: 0.75rem !important;
  }

  /* Compact form controls for medium screens */
  .form-control:not(.form-control-lg) {
    padding: 0.25rem 0.5rem;
    font-size: 0.9rem;
  }

  .form-select:not(.form-select-lg) {
    padding: 0.25rem 0.5rem;
    font-size: 0.9rem;
  }

  .btn:not(.btn-lg) {
    padding: 0.375rem 0.75rem;
    font-size: 0.85rem;
  }

  /* Compact table styles */
  .table th,
  .table td {
    padding: 0.5rem !important;
    font-size: 0.85rem;
  }

  /* Compact card headers */
  .card-header {
    padding: 0.5rem 0.75rem !important;
  }

  .card-header h5,
  .card-header h6 {
    font-size: 0.95rem !important;
  }
}

/* Loading states */
.spinner-border-sm {
  width: 1rem;
  height: 1rem;
}

/* Custom scrollbar */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8;
}

/* UserBotSettings */
.trix-button-group--file-tools {
  display: none !important;
}

.form-switch {
  padding-top: 2.5em;
}

/* Notifications */
.notifications-sidebar {
  background: white;
  border-right: 1px solid #e4e6ea;
  display: flex;
  flex-direction: column;
  padding-bottom: 10px;
}

.notifications-header {
  background: #4267b2;
  color: white;
  padding: 15px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.notifications-header h5 {
  margin: 0;
  font-weight: 600;
}

.search-bar {
  display: flex;
  align-items: center;
  gap: 10px; /* khoảng cách giữa select và input */
  padding: 12px 16px;
  background: white;
  border-bottom: 1px solid #e4e6ea;
  flex-wrap: wrap; /* tự xuống dòng nếu màn hình nhỏ */
}

.search-bar select {
  padding: 6px 8px;
  border-radius: 6px;
  border: 1px solid #e4e6ea;
  background-color: #fff;
  font-size: 14px;
  color: #333;
}

.search-input {
  flex: 1; /* tự giãn để chiếm phần còn lại */
  min-width: 200px;
  padding: 8px 12px;
  border: 1px solid #e4e6ea;
  border-radius: 20px;
  outline: none;
  background: #f0f2f5;
  font-size: 14px;
}

.search-input:focus {
  background: white;
  border-color: #4267b2;
}

/* DataWarehouse */
.dw-card {
  max-height: 210vh;
  overflow-y: auto;
}

.left-panel-dw {
  width: 300px;
  overflow-y: auto;
}

.bg-light {
  --bs-bg-opacity: 0;
}

.pagination .page-link {
  border: none;
  margin: 0 2px;
}

.mt-3 {
  margin-top: 0px !important;
}

.pagination .page-item.active .page-link {
  background-color: #0d6efd;
  border-radius: 6px;
}

.pagination .page-item.disabled .page-link {
  color: #aaa;
}

/* ==============================
   LAYOUT STRUCTURE
============================== */
.container.d-flex {
  padding: 0;
}

#main,
footer.ml {
  transition: margin-left 0.5s;
  margin-left: 200px; /* Reduced for compact layout */
}
footer.ml {
  position: fixed;
}

/* ==============================
   SIDEBAR (LEFT MENU)
============================== */
.left-menu {
  background: #f1f2f7;
  padding: 15px 0; /* Reduced padding */
  height: 100%;
  width: 200px; /* Reduced width */
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1;
  overflow-x: hidden;
  transition: 0.5s;
}

/* --- Logo Section --- */
.logo {
  text-align: center;
  text-transform: uppercase;
  font-weight: bold;
  color: #00904e;
  border-bottom: 1px solid #c8cbd9;
  padding-bottom: 8px; /* Reduced padding */
  font-size: 0.9rem; /* Smaller font */
}

/* --- Sidebar Toggle Buttons --- */
.open-sidebar {
  position: absolute;
  top: 8px; /* Reduced */
  left: 10px; /* Reduced */
  background: linear-gradient(135deg, #00904e 0%, #4bd187 100%);
  border-radius: 6px; /* Reduced */
  color: white;
  padding: 6px 10px; /* Reduced */
  border: none;
  font-size: 16px; /* Reduced */
  cursor: pointer;
}
.open-sidebar:hover {
  opacity: 0.8;
}

.left-menu .close-sidebar {
  position: absolute;
  top: 15px; /* Reduced */
  right: 20px; /* Reduced */
  color: #00904e !important;
  font-size: 18px; /* Reduced */
  text-decoration: none;
}

/* --- Sidebar Menu --- */
.main-menu {
  padding: 10px; /* Reduced */
}

.parent-menu {
  color: #676b71;
  font-size: 0.95rem; /* Reduced */
  margin-bottom: 0.5rem;
}

ul.child-menu {
  list-style-type: none;
  margin-top: 8px; /* Reduced */
  padding-left: 8px; /* Reduced */
  color: #676b71;
}

.child-menu li {
  padding: 5px 12px; /* Reduced */
}

.child-menu li .nav-link {
  font-size: 0.85rem; /* Added smaller font */
  padding: 0.25rem 0;
}

li.nav-item {
  margin-bottom: 2px; /* Reduced */
}

/* Active / Hover States */
li.nav-item.active,
li.nav-item:hover {
  background: #e3e7f4;
  border-radius: 6px; /* Reduced */
  color: #00904e;
}

.nav-link i {
  margin-right: 12px !important; /* Reduced */
  font-size: 0.9rem; /* Added smaller icons */
}

/* ==============================
   HEADER ACCOUNT INFO
============================== */
.account-name {
  padding: 16px 20px 17px 0;
  text-align: right;
}

/* ==============================
   CARD STYLES
============================== */
.card-custom {
  border: none;
  border-radius: 16px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
  overflow: hidden;
}

/* ==============================
   DASHBOARD HEADER & PERIOD BUTTONS
============================== */
.dashboard .card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid #eee;
  background: linear-gradient(180deg, #f0fff8 0%, #ffffff 100%);
}

.dashboard .card-header h6 {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1rem;
  font-weight: 600;
  color: #00904e;
}

/* --- Time Period Button Group --- */
.dashboard .btn-group-sm .period-btn {
  font-size: 14px;
  font-weight: 500;
  color: #02b766;
  background-color: #f9fbff;
  border: 1px solid #dce3f5;
  padding: 4px 12px;
  box-shadow: none;
  transition: all 0.25s ease;
}

.dashboard .btn-group-sm .period-btn:hover {
  background-color: #eef2ff;
  color: #00904e;
}

.dashboard .btn-group-sm .period-btn.active,
.dashboard .btn-group-sm .period-btn:focus.active {
  background-color: #00904e;
  border-color: #00904e;
  color: #fff;
  box-shadow: 0 2px 6px rgba(74, 99, 231, 0.25);
}

/* Rounded button edges */
.dashboard .btn-group-sm .period-btn:first-child {
  border-top-left-radius: 12px;
  border-bottom-left-radius: 12px;
}

.dashboard .btn-group-sm .period-btn:last-child {
  border-top-right-radius: 12px;
  border-bottom-right-radius: 12px;
}

.dashboard .btn-group-sm .period-btn:not(:first-child) {
  margin-left: -1px;
}

/* ==============================
   TABLE MODERN STYLE
============================== */
.table-modern {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
  background-color: #fff;
  font-family: "Inter", sans-serif;
}

@media (max-width: 576px) {
  /* Extra small screen fixes */
  .card .card-header .card-title {
    font-size: 0.9rem !important;
    padding-right: 3rem;
    max-width: calc(100% - 3.5rem);
  }

  .card-footer .row {
    --bs-gutter-x: 0.5rem;
  }

  .card-footer .btn {
    font-size: 0.75rem !important;
    padding: 0.2rem 0.4rem !important;
  }

  .card-footer .col {
    margin-bottom: 0.25rem;
  }

  /* Stack buttons vertically on very small screens if needed */
  .card-footer .row.text-center {
    flex-direction: column;
  }

  .card-footer .row.text-center .col {
    width: 100%;
    margin-bottom: 0.25rem;
  }
}

@media (max-width: 576px) {
  /* Extra small screen fixes */
  .card .card-header .card-title {
    font-size: 0.9rem !important;
    padding-right: 3rem;
    max-width: calc(100% - 3.5rem);
  }

  .card-footer .row {
    --bs-gutter-x: 0.5rem;
  }

  .card-footer .btn {
    font-size: 0.75rem !important;
    padding: 0.2rem 0.4rem !important;
  }

  .card-footer .col {
    margin-bottom: 0.25rem;
  }

  /* Stack buttons vertically on very small screens if needed */
  .card-footer .row.text-center {
    flex-direction: column;
  }

  .card-footer .row.text-center .col {
    width: 100%;
    margin-bottom: 0.25rem;
  }
}

/* Additional compact utilities for global interface optimization */
.p-compact {
  padding: 0.5rem !important;
}
.px-compact {
  padding-left: 0.5rem !important;
  padding-right: 0.5rem !important;
}
.py-compact {
  padding-top: 0.5rem !important;
  padding-bottom: 0.5rem !important;
}
.m-compact {
  margin: 0.5rem !important;
}
.mb-compact {
  margin-bottom: 0.5rem !important;
}
.mt-compact {
  margin-top: 0.5rem !important;
}

/* Small text utilities */
.text-xs {
  font-size: 0.75rem !important;
}
.text-sm {
  font-size: 0.85rem !important;
}

/* Compact alerts */
.alert-compact {
  padding: 0.5rem 0.75rem;
  font-size: 0.9rem;
}

/* Additional card layout fixes for better spacing */
.card-footer {
  padding: 0.5rem 0.75rem !important;
  background-color: rgba(0, 0, 0, 0.03);
}

.card-footer .row .col + .col {
  margin-left: 0.25rem;
}

/* Better spacing for small buttons in card footer */
.card-footer .btn-sm {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: auto;
}

/* Dropdown menu positioning fix */
.card .dropdown-menu {
  z-index: 1050;
}

.table-modern thead {
  background-color: #00904e !important;
  color: #fff;
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.5px;
  vertical-align: middle;
}

.table-modern th {
  padding: 14px 16px;
  text-align: left;
  font-size: 12px;
  background-color: #00904e !important;
}

.table-modern td {
  padding: 16px;
  vertical-align: middle;
  font-size: 15px;
  color: #333;
  border-bottom: 1px solid #f0f0f0;
}

/* --- Table Action Buttons --- */
.table-modern .btn-action {
  border: none;
  border-radius: 6px;
  color: #fff;
  font-weight: 500;
  padding: 8px 14px;
  margin-right: 4px;
  margin-bottom: 4px;
  transition: all 0.2s ease;
}

.table-modern .btn-action:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

/* --- Active Status Badge --- */
.table-modern .status-active {
  color: #fff;
  padding: 6px 10px;
  border-radius: 20px;
  font-weight: 500;
  font-size: 14px;
}
