/* ============================
   MODERN CARDS/BOXES VARIABLES
   ============================ */
:root {
  --card-bg: #ffffff;
  --card-border-radius: 12px;
  --card-border-color: #f1f5f9;
  --card-shadow: 0 2px 4px rgba(0, 0, 0, 0.05), 0 8px 16px rgba(0, 0, 0, 0.1);
  --card-shadow-hover: 0 4px 8px rgba(0, 0, 0, 0.1), 0 12px 24px rgba(0, 0, 0, 0.15);
  --card-shadow-focus: 0 0 0 3px rgba(14, 165, 233, 0.1);
  --card-transition: all 0.3s ease;
  --card-hover-lift: -2px;
  --card-title-color: #1a202c;
  --card-padding: 20px;
  --card-header-padding: 15px 20px;
}

/* ============================
     BOX/CARD CONTAINER
     ============================ */
.box {
  border: none;
  border-radius: var(--card-border-radius);
  box-shadow: var(--card-shadow);
  transition: var(--card-transition);
  background: var(--card-bg);
  overflow: hidden;
  position: relative;
}

.box:hover {
  /* transform: translateY(var(--card-hover-lift)); */
  box-shadow: var(--card-shadow-hover);
}

.box:focus-within {
  box-shadow: var(--card-shadow-hover), var(--card-shadow-focus);
}

/* ============================
     BOX HEADER
     ============================ */
.box-header {
  background: transparent;
  border-bottom: 1px solid var(--card-border-color);
  padding: var(--card-header-padding);
  position: relative;
}

.box-header.with-border {
  border-bottom: 2px solid var(--card-border-color);
}

.box-header.no-border {
  border-bottom: none;
}

/* Box Title */
.box-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--card-title-color);
  margin: 0;
  line-height: 1.4;
}

.box-title.large {
  font-size: 18px;
  font-weight: 700;
}

.box-title.small {
  font-size: 14px;
  font-weight: 500;
}

/* Box Tools */
.box-tools {
  position: absolute;
  right: 15px;
  top: 50%;
  transform: translateY(-50%);
}

.box-tools .btn {
  padding: 4px 8px;
  font-size: 12px;
}

/* ============================
     BOX BODY
     ============================ */
.box-body {
  padding: var(--card-padding);
}

.box-body.no-padding {
  padding: 0;
}

.box-body.table-responsive {
  padding: 0;
  overflow-x: auto;
}

/* ============================
     BOX FOOTER
     ============================ */
.box-footer {
  background: #fafbfc;
  border-top: 1px solid var(--card-border-color);
  padding: 12px var(--card-padding);
  font-size: 14px;
}

.box-footer.no-background {
  background: transparent;
}

/* ============================
     SMALL BOXES (INFO BOXES)
     ============================ */
.small-box {
  border-radius: var(--card-border-radius);
  border: none;
  box-shadow: var(--card-shadow);
  transition: var(--card-transition);
  position: relative;
  overflow: hidden;
  min-height: 120px;
  color: white;
}

.small-box:hover {
  transform: translateY(var(--card-hover-lift));
  box-shadow: var(--card-shadow-hover);
}

/* Small Box Inner Content */
.small-box .inner {
  padding: 15px 20px;
  position: relative;
  z-index: 2;
}

.small-box h3 {
  font-size: 28px;
  font-weight: 700;
  margin: 0 0 5px 0;
  line-height: 1.2;
}

.small-box p {
  font-size: 14px;
  margin: 0;
  opacity: 0.9;
  font-weight: 500;
}

/* Small Box Icon */
.small-box .icon {
  font-size: 60px;
  position: absolute;
  top: 15px;
  right: 15px;
  transition: var(--card-transition);
  opacity: 0.3;
  z-index: 1;
}

.small-box:hover .icon {
  transform: scale(1.1);
  opacity: 0.4;
}

/* Small Box Footer */
.small-box .small-box-footer {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0, 0, 0, 0.1);
  padding: 8px 15px;
  text-decoration: none;
  color: white;
  font-size: 12px;
  font-weight: 500;
  text-align: center;
  transition: var(--card-transition);
}

.small-box .small-box-footer:hover {
  background: rgba(0, 0, 0, 0.2);
  color: white;
  text-decoration: none;
}

/* ============================
     CARD VARIANTS
     ============================ */

/* Solid Cards */
.box.box-solid .box-header {
  background: var(--card-title-color);
  color: white;
  border-bottom: none;
}

.box.box-solid .box-title {
  color: white;
}

/* Primary Card */
.box.box-primary {
  border-top: 3px solid #007bff;
}

.box.box-primary .box-header {
  color: #007bff;
}

/* Success Card */
.box.box-success {
  border-top: 3px solid #28a745;
}

.box.box-success .box-header {
  color: #28a745;
}

/* Warning Card */
.box.box-warning {
  border-top: 3px solid #ffc107;
}

.box.box-warning .box-header {
  color: #856404;
}

/* Danger Card */
.box.box-danger {
  border-top: 3px solid #dc3545;
}

.box.box-danger .box-header {
  color: #dc3545;
}

/* Info Card */
.box.box-info {
  border-top: 3px solid #17a2b8;
}

.box.box-info .box-header {
  color: #17a2b8;
}

/* ============================
     RESPONSIVE DESIGN
     ============================ */
@media (max-width: 768px) {
  .box-body {
    padding: 15px;
  }

  .box-header {
    padding: 12px 15px;
  }

  .small-box .inner {
    padding: 12px 15px;
  }

  .small-box h3 {
    font-size: 24px;
  }

  .small-box .icon {
    font-size: 50px;
    top: 12px;
    right: 12px;
  }
}

@media (max-width: 480px) {
  .box {
    border-radius: 8px;
  }

  .small-box {
    border-radius: 8px;
    min-height: 100px;
  }

  .small-box .icon {
    font-size: 40px;
  }
}

/* ============================
     ACCESSIBILITY IMPROVEMENTS
     ============================ */
.box:focus-visible,
.small-box:focus-visible {
  outline: 2px solid #007bff;
  outline-offset: 2px;
}

.small-box .small-box-footer:focus {
  outline: 2px solid white;
  outline-offset: -2px;
}