/* Asasify PM - Drilldown System Styles */

/* Drilldown Panel */
.drilldown-panel {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.drilldown-panel.active {
    opacity: 1;
    visibility: visible;
}

.drilldown-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    cursor: pointer;
}

.drilldown-content {
    position: absolute;
    top: 0;
    right: -600px;
    width: 600px;
    max-width: 95%;
    height: 100%;
    background: white;
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.2);
    overflow-y: auto;
    transition: right 0.3s ease;
    display: flex;
    flex-direction: column;
}

.drilldown-panel.active .drilldown-content {
    right: 0;
}

/* Header */
.drilldown-header {
    padding: 1.5rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 10;
}

.drilldown-breadcrumbs {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.breadcrumb-item {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.8);
    cursor: default;
}

.breadcrumb-item:not(.active) {
    cursor: pointer;
    text-decoration: underline;
}

.breadcrumb-item:not(.active):hover {
    color: white;
}

.breadcrumb-separator {
    font-size: 0.75rem;
    opacity: 0.6;
}

.drilldown-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.drilldown-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

/* Title */
.drilldown-title {
    padding: 1.5rem;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.drilldown-icon {
    font-size: 2rem;
}

.drilldown-title h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1f2937;
    margin: 0;
}

/* Body */
.drilldown-body {
    flex: 1;
    padding: 1.5rem;
    overflow-y: auto;
}

/* Sections */
.drilldown-section {
    margin-bottom: 2rem;
}

.drilldown-section:last-child {
    margin-bottom: 0;
}

.section-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e5e7eb;
}

/* Metrics Grid */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
}

.metric-card {
    background: #f9fafb;
    padding: 1rem;
    border-radius: 0.5rem;
    border: 1px solid #e5e7eb;
    transition: all 0.2s ease;
}

.metric-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.metric-label {
    font-size: 0.75rem;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.metric-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1f2937;
}

.metric-trend,
.metric-status {
    font-size: 0.875rem;
    margin-top: 0.5rem;
}

.metric-trend.increasing {
    color: #ef4444;
}

.metric-trend.decreasing {
    color: #10b981;
}

.metric-status.excellent {
    color: #10b981;
}

.metric-status.good {
    color: #3b82f6;
}

/* Category List */
.category-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.category-item {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.category-item:hover {
    border-color: #667eea;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.1);
    transform: translateX(4px);
}

.category-info {
    flex: 1;
}

.category-name {
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 0.25rem;
}

.category-amount {
    font-size: 1.125rem;
    font-weight: 700;
    color: #667eea;
}

.category-bar {
    flex: 1;
    height: 8px;
    background: #e5e7eb;
    border-radius: 9999px;
    overflow: hidden;
}

.category-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    transition: width 1s ease;
}

/* Timeline List */
.timeline-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.timeline-item {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 1rem;
    align-items: center;
}

.timeline-item:hover {
    border-color: #667eea;
    transform: translateX(4px);
}

.timeline-month {
    font-weight: 600;
    color: #374151;
    width: 100px;
}

.timeline-bar {
    height: 6px;
    background: #e5e7eb;
    border-radius: 9999px;
    overflow: hidden;
}

.timeline-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
}

.timeline-amount {
    font-weight: 700;
    color: #667eea;
    text-align: right;
}

/* Alerts */
.no-alerts {
    text-align: center;
    padding: 2rem;
    color: #6b7280;
}

.no-alerts i {
    font-size: 3rem;
    margin-bottom: 0.5rem;
}

.alerts-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.alert-item {
    padding: 1rem;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.alert-item:hover {
    transform: translateX(4px);
}

.alert-item.alert-critical {
    background: #fef2f2;
    border: 1px solid #fecaca;
}

.alert-item.alert-warning {
    background: #fffbeb;
    border: 1px solid #fde68a;
}

.alert-item.alert-info {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
}

.alert-icon {
    font-size: 1.5rem;
}

.alert-content {
    flex: 1;
}

.alert-title {
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 0.25rem;
}

.alert-message {
    font-size: 0.875rem;
    color: #6b7280;
}

/* Transactions Table */
.transactions-table-wrapper {
    overflow-x: auto;
}

.transactions-table {
    width: 100%;
    border-collapse: collapse;
}

.transactions-table thead {
    background: #f9fafb;
    border-bottom: 2px solid #e5e7eb;
}

.transactions-table th {
    padding: 0.75rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.875rem;
    color: #374151;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.transactions-table td {
    padding: 0.75rem;
    border-bottom: 1px solid #e5e7eb;
    color: #1f2937;
}

.transaction-row {
    cursor: pointer;
    transition: background 0.2s ease;
}

.transaction-row:hover {
    background: #f9fafb;
}

/* Alert Detail Card */
.alert-detail-card {
    border-radius: 0.5rem;
    padding: 1.5rem;
}

.alert-detail-card.alert-critical {
    background: #fef2f2;
    border: 2px solid #ef4444;
}

.alert-detail-card.alert-warning {
    background: #fffbeb;
    border: 2px solid #f59e0b;
}

.alert-detail-message {
    font-size: 1rem;
    color: #1f2937;
    margin-bottom: 1rem;
}

.alert-detail-details {
    font-size: 0.875rem;
    color: #6b7280;
}

.alert-impact {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    font-size: 0.875rem;
}

/* Action Plan */
.action-plan {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.action-item {
    padding: 1rem;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    border: 1px solid #e5e7eb;
}

.action-item.priority-high {
    background: #fef2f2;
    border-color: #fecaca;
}

.action-priority {
    background: #ef4444;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.action-text {
    flex: 1;
    color: #1f2937;
}

/* Risk Overview */
.risk-overview {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 2rem;
}

.risk-circle {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: 8px solid;
    margin-bottom: 1rem;
}

.risk-circle.risk-high {
    border-color: #ef4444;
    background: #fef2f2;
}

.risk-circle.risk-medium {
    border-color: #f59e0b;
    background: #fffbeb;
}

.risk-circle.risk-low {
    border-color: #10b981;
    background: #f0fdf4;
}

.risk-score {
    font-size: 3rem;
    font-weight: 700;
}

.risk-max {
    font-size: 1rem;
    color: #6b7280;
}

.risk-label {
    font-size: 1.25rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* Risk Factors */
.risk-factors-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.risk-factor-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: #fffbeb;
    border-radius: 0.5rem;
    border: 1px solid #fde68a;
}

.risk-factor-item i {
    font-size: 1.25rem;
}

/* Transaction Details */
.transaction-details {
    background: #f9fafb;
    border-radius: 0.5rem;
    padding: 1.5rem;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 0;
    border-bottom: 1px solid #e5e7eb;
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-label {
    color: #6b7280;
    font-weight: 500;
}

.detail-value {
    color: #1f2937;
    font-weight: 600;
}

/* Footer */
.drilldown-footer {
    padding: 1.5rem;
    border-top: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    position: sticky;
    bottom: 0;
    background: white;
}

/* Buttons */
.btn-primary,
.btn-secondary {
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    display: inline-flex;
    align-items: center;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-secondary {
    background: white;
    color: #374151;
    border: 1px solid #e5e7eb;
}

.btn-secondary:hover {
    background: #f9fafb;
}

/* Responsive */
@media (max-width: 768px) {
    .drilldown-content {
        width: 100%;
        right: -100%;
    }

    .metrics-grid {
        grid-template-columns: 1fr;
    }
}

/* Utilities */
.text-right {
    text-align: right;
}

.text-center {
    text-align: center;
}

.text-muted {
    color: #6b7280;
}

.text-success {
    color: #10b981;
}

.text-warning {
    color: #f59e0b;
}

.font-bold {
    font-weight: 700;
}

.font-semibold {
    font-weight: 600;
}

.mr-2 {
    margin-right: 0.5rem;
}

.mt-3 {
    margin-top: 0.75rem;
}