/* Custom CSS for ASM Dashboard Commission Tab */

/* General Styles */
.asm-dashboard-content h2, .asm-dashboard-content h3 {
    border-left: 5px solid #0073aa; /* WordPress Blue */
    padding-left: 10px;
    margin-top: 30px;
}

/* Summary Cards/Boxes */
.asm-summary-grid {
    display: grid;
    /* Responsive layout: minimum width of 280px for each column */
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); 
    gap: 20px;
    margin-bottom: 25px;
}

.asm-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    padding: 20px;
    transition: transform 0.2s, box-shadow 0.2s;
    min-height: 120px; /* Consistent height for better look */
}
.asm-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.1);
}

.asm-card h4 {
    margin-top: 0;
    font-size: 1.1em;
    color: #555;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
    margin-bottom: 15px;
    font-weight: 600;
}

.asm-card .value {
    font-size: 2em;
    font-weight: 700;
    margin: 10px 0 0;
    line-height: 1.2;
}

/* Highlight card for Net Due */
.asm-card.highlight-card {
    background: #fff3e0;
    border-width: 2px;
}

/* Status Colors (use !important to override default inline styles if any) */
.color-green { color: #4CAF50 !important; } /* Settled */
.color-red { color: #F44336 !important; }    /* Due/Outstanding */
.color-blue { color: #2196F3 !important; }   /* Commission Earned (or Admin owes Agent) */
.color-dark { color: #333 !important; }

/* Table styling adjustments */
.wp-list-table th, .wp-list-table td {
    vertical-align: middle;
}

/* Grand Total Box */
.asm-dashboard-content > div:last-child[style*="border: 2px solid #000"] {
    background: #fffde7; 
    border-color: #fdd835 !important; 
    border-width: 2px;
}
.asm-dashboard-content > div:last-child[style*="border: 2px solid #000"] h3 strong {
    font-size: 2em !important;
}

/* Agent Section Box */
.asm-agent-section {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}
.asm-agent-section h3 {
    margin-top: 0 !important;
    padding-top: 0;
}

/* --- COMMISSION CARDS SPECIFIC STYLES --- */

.asm-card.commission-today {
    background: #e8f5e9; /* Light Green */
    border-left: 5px solid #4CAF50; /* Green Border */
    min-height: 100px;
}

.asm-card.commission-month {
    background: #e3f2fd; /* Light Blue */
    border-left: 5px solid #2196F3; /* Blue Border */
    min-height: 100px;
}

.asm-card.commission-alltime {
    background: #fff3e0; /* Light Orange */
    border-left: 5px solid #ff9800; /* Orange Border */
    min-height: 100px;
}

/* Net Due/Liability कार्ड को और हाइलाइट करें */
.asm-card.highlight-card {
    background: #ffebee; /* Light Red/Pink */
    border-color: #F44336; /* Red Border */
    border-left: 5px solid #F44336;
    min-height: 100px;
}
.asm-card.highlight-card h4 {
    color: #F44336 !important;
}

/* Agent Liability Card (blue) को अलग से स्टाइल करें */
.asm-agent-section .asm-card.highlight-card[style*="border-color: #2196F3"] {
    background: #bbdefb; /* Lighter Blue */
    border-color: #2196F3 !important;
    border-left: 5px solid #2196F3 !important;
}
.asm-agent-section .asm-card.highlight-card[style*="border-color: #2196F3"] h4 {
    color: #2196F3 !important;
}

/* --- NEW: MODAL PAYMENT FORM STYLES (Vertical Layout) --- */

/* मुख्य कंटेनर को साफ रखें */
.asm-settlement-row {
    padding: 20px;
    margin-top: 15px;
    border: 1px solid #e0e0e0;
    border-radius: 8px; 
    background-color: #f9f9f9;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05); 
    max-width: 400px; /* फॉर्म को कॉम्पैक्ट रखें */
}

/* फॉर्म को Flexbox दें ताकि सभी प्रमुख तत्व (फ़ील्ड ग्रुप, बटन, मैसेज) लंबवत दिखें */
.asm-settlement-form-ajax {
    display: flex;
    flex-direction: column; /* तत्वों को ऊपर से नीचे व्यवस्थित करें */
    gap: 15px; /* तत्वों के बीच की दूरी */
}

/* फॉर्म ग्रुप्स को पूरी चौड़ाई दें (यह ज़रूरी है कि आपके PHP HTML में <div class="form-group"> हो) */
.form-group {
    display: flex; /* लेबल और इनपुट को फ्लेक्सबॉक्स दें */
    flex-direction: column; /* लेबल और इनपुट को ऊपर-नीचे करें */
    width: 100%;
    margin-bottom: 0; 
}

/* इनपुट लेबल स्टाइल */
.asm-settlement-form-ajax label {
    font-weight: 600;
    color: #333;
    font-size: 14px;
    text-align: left; /* लेबल को बाईं ओर संरेखित करें */
    margin-bottom: 5px; /* इनपुट से लेबल को अलग करें */
}

/* इनपुट फ़ील्ड स्टाइल */
.asm-settlement-form-ajax input[type="number"],
.asm-settlement-form-ajax input[type="text"] {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 16px;
    box-sizing: border-box; 
    transition: border-color 0.3s, box-shadow 0.3s;
}

/* इनपुट फोकस होने पर */
.asm-settlement-form-ajax input:focus {
    border-color: #0073aa; 
    box-shadow: 0 0 0 1px #0073aa;
    outline: none;
}

/* मैसेज डिव (सक्सेस/एरर) */
.settlement-message {
    margin-top: 0;
    padding: 10px;
    border-radius: 4px;
    font-size: 13px;
    text-align: center;
}

/* सबमिट बटन स्टाइल */
.asm-settlement-form-ajax button.asm-settlement-submit-btn {
    width: 100%;
    padding: 12px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    background-color: #4CAF50; 
    color: white;
    border: none;
    border-radius: 5px;
    transition: background-color 0.3s;
}

.asm-settlement-form-ajax button.asm-settlement-submit-btn:hover:not(:disabled) {
    background-color: #45a049;
}

.asm-settlement-form-ajax button.asm-settlement-submit-btn:disabled {
    background-color: #a0a0a0;
    cursor: not-allowed;
}

/* --- NEW: ACTION BUTTON STACKING --- */
/* Action Column के बटन को लंबवत स्टैक करें */
.wp-list-table td:last-child a.button {
    /* प्रत्येक बटन को एक ब्लॉक तत्व बनाएं ताकि वे एक नई लाइन लें */
    display: block; 
    margin: 5px 0; /* बटन के ऊपर और नीचे थोड़ा मार्जिन */
    width: 100%; /* बटन को पूरी चौड़ाई दें */
    box-sizing: border-box;
    white-space: normal; /* text को wrap करने दें */
    text-align: center;
}

/* सुनिश्चित करें कि Action सेल में Text Align Center हो */
.wp-list-table td:last-child {
    text-align: center;
}
