/* --- LAYOUT --- */
.meridian-wrapper { 
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; 
    background: #f4f6f8; 
    padding: 15px; 
    /* Fix for WP Admin Left Margin */
    margin-left: -30px; 
    width: calc(100% + 30px); 
    box-sizing: border-box;
}

.meridian-header { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    margin-bottom: 15px; 
    padding-bottom: 10px; 
    border-bottom: 1px solid #ddd; 
}
.meridian-header h1 { margin: 0; font-size: 22px; color: #333; }

/* --- NAVIGATION --- */
.meridian-nav { display: flex; gap: 5px; margin-bottom: 20px; background: #fff; padding: 8px 15px; border-radius: 4px; box-shadow: 0 1px 2px rgba(0,0,0,0.05); }
.nav-item { text-decoration: none; color: #555; padding: 8px 15px; border-radius: 4px; font-weight: 600; font-size: 12px; transition: all 0.2s; }
.nav-item:hover { background: #f0f0f1; color: #007cba; }
.nav-item.active { background: #007cba; color: #fff; }

/* --- GRID SYSTEM (COMPACT) --- */
.grid-6 { 
    display: grid; 
    grid-template-columns: repeat(6, 1fr); 
    gap: 10px; 
    margin-bottom: 15px; 
}
.grid-5 { 
    display: grid; 
    grid-template-columns: repeat(5, 1fr); 
    gap: 10px; /* Reduced gap to fit row */
    margin-bottom: 15px; 
}

.grid-4 { 
    display: grid; 
    grid-template-columns: repeat(4, 1fr); 
    gap: 10px; 
    margin-bottom: 15px; 
}

/* Responsive: Only wrap on very small screens now */
@media (max-width: 1300px) { .grid-5 { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 1100px) { .grid-4 { grid-template-columns: repeat(2, 1fr); } }

/* --- CARD STYLING --- */
.dash-card, .chart-card { 
    background: #fff; 
    border-radius: 4px; 
    box-shadow: 0 1px 3px rgba(0,0,0,0.1); 
    display: flex; 
    flex-direction: column; 
    overflow: hidden;
    border: 1px solid #ccc; /* Defined border for clear blocks */
}

/* Row 1 Height */
.dash-card { height: 150px; } 

/* Row 2 & 3 Height */
.chart-card { height: 200px; }

/* --- HEADER (BLACK & BOLD) --- */
.card-header {
    background: #000; /* Black Background */
    color: #fff;      /* White Text */
    padding: 6px 0;
    text-align: center;
    width: 100%;
    flex-shrink: 0;
}

.card-header h4 {
    margin: 0;
    font-size: 11px;
    font-weight: 700; /* Bold */
    color: #fff !important; /* Force White */
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* --- CARD BODY --- */
.card-body { 
    padding: 10px; 
    flex-grow: 1; 
    display: flex; 
    flex-direction: column; 
    justify-content: center; 
    position: relative;
}

.metric-value { font-size: 26px; font-weight: 700; color: #333; text-align: center; margin: 2px 0; line-height: 1; }
.metric-sub { font-size: 10px; text-align: center; color: #777; margin-bottom: 4px; }

.metric-footer { 
    border-top: 1px solid #eee; 
    padding-top: 5px; 
    margin-top: auto; 
    display: flex; 
    justify-content: space-between; 
    font-size: 10px; 
    color: #555; 
    font-weight: 600; 
}

/* --- CHART WRAPPER --- */
.chart-wrapper { 
    flex-grow: 1; 
    position: relative; 
    width: 100%; 
    height: 100%; 
}

/* --- NEW: User Menu Styles --- */
.meridian-nav {
    display: flex;
    align-items: center; /* Vertically center items */
}

.nav-user-menu {
    margin-left: auto; /* Pushes to the far right */
    display: flex;
    align-items: center;
    gap: 10px;
    padding-right: 15px;
}

.nav-user-greeting {
    font-size: 12px;
    font-weight: 600;
    color: #555;
}

.nav-item-logout {
    font-size: 11px;
    font-weight: 600;
    color: #007cba;
    text-decoration: none;
    padding: 5px 10px;
    background: #f0f0f1;
    border-radius: 4px;
}
.nav-item-logout:hover {
    background: #e0e0e0;
    color: #dc3232;
}

/* --- NEW: Table Styles --- */
.meridian-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.meridian-table th,
.meridian-table td {
    border: 1px solid #e0e0e0;
    padding: 10px 12px;
    text-align: left;
    font-size: 13px;
    vertical-align: middle;
}
.meridian-table th {
    background: #f9f9f9;
    font-weight: 600;
    color: #333;
}
.meridian-table tbody tr:nth-child(even) {
    background: #fdfdfd;
}

/* --- NEW: Button Styles --- */
.btn {
    padding: 8px 15px;
    font-size: 13px;
    font-weight: 600;
    border: 1px solid transparent;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
}
.btn-primary {
    background: #007cba;
    color: #fff;
    border-color: #007cba;
}
.btn-primary:hover {
    background: #005a87;
}

/* --- NEW: Small Action Buttons --- */
.btn-sm-edit, .btn-sm-delete {
    font-size: 11px;
    padding: 4px 8px;
    margin-right: 4px;
    cursor: pointer;
}
.btn-sm-edit {
    background: #f0f0f0;
    border: 1px solid #ccc;
    color: #333;
}
.btn-sm-edit:hover {
    background: #e0e0e0;
}
.btn-sm-delete {
    background: #dc3232;
    border: 1px solid #dc3232;
    color: #fff;
}
.btn-sm-delete:hover {
    background: #a02020;
}

/* --- NEW: Status Pills --- */
.status-active, .status-inactive {
    padding: 3px 7px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: #fff;
}
.status-active {
    background: #28a745;
}
.status-inactive {
    background: #777;
}/* --- MODAL TABS --- */
.meridian-tabs {
    display: flex;
    border-bottom: 1px solid #ddd;
    margin-bottom: 15px;
    background: #f9f9f9;
}
.meridian-tabs .tab {
    padding: 10px 20px;
    cursor: pointer;
    font-weight: 600;
    color: #555;
    border-right: 1px solid #eee;
}
.meridian-tabs .tab:hover { background: #eee; }
.meridian-tabs .tab.active {
    background: #fff;
    color: #007cba;
    border-bottom: 2px solid #007cba;
    margin-bottom: -1px;
}
.tab-content { display: none; }
.tab-content.active { display: block; animation: fadeIn 0.2s; }

@keyframes fadeIn { from { opacity:0; } to { opacity:1; } }

/* --- FORM GRID inside Modal --- */
.row { display: flex; gap: 15px; margin-bottom: 15px; }
.col { flex: 1; }
.form-group { margin-bottom: 15px; }
.form-group label, .col label { display: block; margin-bottom: 5px; font-weight: 600; font-size: 12px; color: #444; }
.form-group input, .form-group select, .col input, .col select {
    width: 100%; padding: 8px; border: 1px solid #ccc; border-radius: 4px; box-sizing: border-box;
}

/* --- ICON BUTTONS --- */
.btn-icon {
    background: none; border: none; cursor: pointer; font-size: 16px; padding: 2px 5px; transition: transform 0.1s;
}
.btn-icon:hover { transform: scale(1.2); }

/* --- OVERLAY --- */
.meridian-modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.5); z-index: 9999;
    display: flex; justify-content: center; align-items: center;
}
.meridian-modal {
    background: #fff; border-radius: 5px; box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    display: flex; flex-direction: column; max-height: 90vh;
}
.meridian-modal-header {
    padding: 15px; border-bottom: 1px solid #eee; display: flex; justify-content: space-between; align-items: center;
}
.meridian-modal-body { padding: 20px; overflow-y: auto; }
.meridian-modal-footer { padding: 15px; border-top: 1px solid #eee; text-align: right; }

/* --- UTILS --- */
.trend-up { color: #28a745; } .trend-down { color: #dc3232; } .trend-neutral { color: #777; }
.border-blue { border-top: 4px solid #007cba; } 
.border-green { border-top: 4px solid #46b450; } 
.border-orange { border-top: 4px solid #f39c12; } 
.border-purple { border-top-color: #9b59b6; }

.loading-spinner { text-align: center; padding: 50px; color: #999; }
.notice-error { color: #dc3232; background: #fff; padding: 20px; border-left: 4px solid #dc3232; }