/* =========================================================
   DASHBOARD STYLING — MODERN GRADIENT CARDS & ERP DASHBOARDS
   ========================================================= */

.db-head {
    display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap;
    margin-bottom: 24px;
}
.db-title { margin: 0; font-size: 1.45rem; font-weight: 700; color: #0f172a; letter-spacing: -.02em; }
.db-sub { margin: 4px 0 0; color: #64748b; font-size: .9rem; }

/* Dashboard Hero Banner */
.db-hero-banner {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 20px 24px;
    margin-bottom: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}
.db-hero-info { display: flex; align-items: center; gap: 16px; }
.db-hero-avatar {
    width: 52px; height: 52px;
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 1.5rem; flex-shrink: 0;
}
.db-hero-title { margin: 0; font-size: 1.25rem; font-weight: 700; color: #1e293b; }
.db-hero-sub { margin: 3px 0 0; font-size: .86rem; color: #64748b; }
.db-hero-tags { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.db-hero-badge {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 4px 10px; border-radius: 8px; font-size: 0.8rem; font-weight: 600;
}

/* KPI Grids */
.db-kpis {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}
.db-kpis-4 {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}
.db-kpis-3 {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

/* =========================================================
   GRADIENT CARDS (Vibrant, modern, readable white text)
   ========================================================= */

.gradient-card {
    border-radius: 12px;
    padding: 13px 16px;
    color: #ffffff !important;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 98px;
    text-decoration: none !important;
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.gradient-card:hover {
    transform: translateY(-4px);
    color: #ffffff !important;
    text-decoration: none !important;
}

/* Card Glow drop-shadows */
.gradient-card-indigo {
    background: linear-gradient(135deg, #4f46e5 0%, #312e81 100%);
    box-shadow: 0 4px 14px 0 rgba(79, 70, 229, 0.3);
}
.gradient-card-indigo:hover {
    box-shadow: 0 8px 25px 0 rgba(79, 70, 229, 0.45);
}

.gradient-card-emerald {
    background: linear-gradient(135deg, #059669 0%, #064e3b 100%);
    box-shadow: 0 4px 14px 0 rgba(5, 150, 105, 0.3);
}
.gradient-card-emerald:hover {
    box-shadow: 0 8px 25px 0 rgba(5, 150, 105, 0.45);
}

.gradient-card-amber {
    background: linear-gradient(135deg, #d97706 0%, #78350f 100%);
    box-shadow: 0 4px 14px 0 rgba(217, 119, 6, 0.3);
}
.gradient-card-amber:hover {
    box-shadow: 0 8px 25px 0 rgba(217, 119, 6, 0.45);
}

.gradient-card-rose {
    background: linear-gradient(135deg, #e11d48 0%, #881337 100%);
    box-shadow: 0 4px 14px 0 rgba(225, 29, 72, 0.3);
}
.gradient-card-rose:hover {
    box-shadow: 0 8px 25px 0 rgba(225, 29, 72, 0.45);
}

.gradient-card-cyan {
    background: linear-gradient(135deg, #0284c7 0%, #0c4a6e 100%);
    box-shadow: 0 4px 14px 0 rgba(2, 132, 199, 0.3);
}
.gradient-card-cyan:hover {
    box-shadow: 0 8px 25px 0 rgba(2, 132, 199, 0.45);
}

.gradient-card-purple {
    background: linear-gradient(135deg, #7c3aed 0%, #4c1d95 100%);
    box-shadow: 0 4px 14px 0 rgba(124, 58, 237, 0.3);
}
.gradient-card-purple:hover {
    box-shadow: 0 8px 25px 0 rgba(124, 58, 237, 0.45);
}

.gradient-card-teal {
    background: linear-gradient(135deg, #0d9488 0%, #134e4a 100%);
    box-shadow: 0 4px 14px 0 rgba(13, 148, 136, 0.3);
}
.gradient-card-teal:hover {
    box-shadow: 0 8px 25px 0 rgba(13, 148, 136, 0.45);
}

.gradient-card-blue {
    background: linear-gradient(135deg, #2563eb 0%, #1e3a8a 100%);
    box-shadow: 0 4px 14px 0 rgba(37, 99, 235, 0.3);
}
.gradient-card-blue:hover {
    box-shadow: 0 8px 25px 0 rgba(37, 99, 235, 0.45);
}

.gradient-card-orange {
    background: linear-gradient(135deg, #ea580c 0%, #7c2d12 100%);
    box-shadow: 0 4px 14px 0 rgba(234, 88, 12, 0.3);
}
.gradient-card-orange:hover {
    box-shadow: 0 8px 25px 0 rgba(234, 88, 12, 0.45);
}

/* Card Decorative Backdrop Shapes */
.gradient-card::after {
    content: '';
    position: absolute;
    right: -20px;
    bottom: -20px;
    width: 110px;
    height: 110px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.15) 0%, rgba(255, 255, 255, 0) 70%);
    border-radius: 50%;
    pointer-events: none;
}

/* Card internal parts */
.gradient-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    position: relative;
    z-index: 1;
}

.gradient-card-label {
    font-size: 0.70rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.gradient-card-icon-wrap {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.18);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    flex-shrink: 0;
}

.gradient-card-value {
    margin-top: 6px;
    font-size: 1.25rem;
    font-weight: 700;
    color: #ffffff;
    line-height: 1.15;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.01em;
    position: relative;
    z-index: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.gradient-card-foot {
    margin-top: 6px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    position: relative;
    z-index: 1;
}

.gradient-card-note {
    font-size: 0.70rem;
    color: rgba(255, 255, 255, 0.82);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.gradient-card-badge {
    background: rgba(255, 255, 255, 0.22);
    backdrop-filter: blur(4px);
    color: #ffffff;
    padding: 1px 7px;
    border-radius: 5px;
    font-size: 0.66rem;
    font-weight: 600;
    white-space: nowrap;
}

/* =========================================================
   PANELS & GRIDS
   ========================================================= */

.db-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.db-grid-equal { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; align-items: start; }

.db-panel {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.db-panel-head {
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
    padding: 16px 20px;
    border-bottom: 1px solid #f1f5f9;
}
.db-panel-head h2 { margin: 0; font-size: 1rem; font-weight: 700; color: #1e293b; }
.db-muted { font-size: .8rem; color: #64748b; font-weight: 500; }
.db-panel-foot { padding: 12px 20px; border-top: 1px solid #f1f5f9; font-size: .85rem; }
.db-panel-foot a { color: #2563eb; text-decoration: none; font-weight: 600; }
.db-panel-foot a:hover { text-decoration: underline; }

.db-list { list-style: none; margin: 0; padding: 0; }
.db-list li + li { border-top: 1px solid #f1f5f9; }
.db-list-row {
    display: flex; align-items: center; gap: 14px; padding: 14px 20px;
    color: inherit; text-decoration: none; transition: background-color 0.15s ease;
}
.db-list-row:hover { background: #f8fafc; text-decoration: none; }
.db-list-row:hover .db-list-title { color: #2563eb; }
.db-list-main { flex: 1; min-width: 0; }
.db-list-title { font-size: .9rem; font-weight: 600; color: #1e293b; transition: color 0.15s ease; }
.db-list-sub { margin-top: 3px; font-size: .78rem; color: #64748b; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.db-list-chevron { color: #94a3b8; flex-shrink: 0; }

.db-info { margin: 0; padding: 6px 20px; }
.db-info-row { display: flex; justify-content: space-between; gap: 16px; padding: 12px 0; }
.db-info-row + .db-info-row { border-top: 1px solid #f1f5f9; }
.db-info dt { font-weight: 500; font-size: .84rem; color: #64748b; }
.db-info dd { margin: 0; font-size: .86rem; font-weight: 600; color: #1e293b; text-align: right; text-transform: none; }

.db-empty { padding: 32px 20px; color: #64748b; font-size: .88rem; text-align: center; }

/* Responsive adjustments */
@media (max-width: 1200px) {
    .db-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .db-kpis-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 991px) {
    .db-grid, .db-grid-equal { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
    .db-kpis, .db-kpis-4, .db-kpis-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .gradient-card { padding: 11px 13px; min-height: 88px; }
    .gradient-card-value { font-size: 1.15rem; }
}
@media (max-width: 420px) {
    .db-kpis, .db-kpis-4, .db-kpis-3 { grid-template-columns: 1fr; }
}
